1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-13 09:47:29 +01:00
Commit Graph

247 Commits

Author SHA1 Message Date
Barney Laurance
7f4173efc5 Fix typo in docs 2019-05-14 19:30:39 -04:00
Barney Laurance
f4c754737f psalm-internal: Prevent use of @psalm-internal without @internal 2019-05-14 18:54:16 -04:00
Barney Laurance
31ae10fb00 psalm-internal - document usage of @internal and @psalm-internal tags 2019-05-14 18:54:16 -04:00
Brown
30cbcb6c36 Add ImplementedParamTypeMismatch issue
Fixes #1633
2019-05-14 15:44:46 -04:00
Jonathan H. Wage
ecb7a6c069 Add support for absolute plugin paths. 2019-05-05 16:44:36 -04:00
Jonathan H. Wage
db227dab06 Fix link to Plugins that currently 404s 2019-05-02 17:49:34 -04:00
Brown
0e4c8ce482 Split apart TypeCoercion issues, allowing more granular issue filtering 2019-04-25 18:02:19 -04:00
Ryan McCue
91be079ca6 Link to human-readable package list 2019-04-21 08:42:35 -04:00
Matthew Brown
29b70442b1 Add documentation for unused method/property removal/ 2019-04-20 17:54:17 -04:00
Dave Liddament
53e2a0e671 FIX remove extra space in markdown 2019-04-18 18:18:16 -04:00
bugreportuser
4a931770be Added doc for onlyGlobalScope 2019-04-16 22:42:45 -04:00
Matthew Brown
b00aa848e4 Split up plugins guide 2019-04-14 15:21:41 -04:00
Matthew Brown
5374211fc1
Add link to how Psalm represents types 2019-04-14 15:13:47 -04:00
Matthew Brown
7eab5cf6df Few small improvements 2019-04-14 15:12:16 -04:00
Matthew Brown
2a862040c1 Add more documentation 2019-04-14 15:12:16 -04:00
Robert Hickman
7b5e3c88e3 fix markdown error 2019-04-14 15:12:16 -04:00
Robert Hickman
a1cbf41a0e fix markdown error 2019-04-14 15:12:16 -04:00
Robert Hickman
28ecccb364 added plugins type system documentation 2019-04-14 15:12:16 -04:00
Brown
af4d10cb63 Fix #1499 - use TraitMethodSignatureMismatch when dealing with trait methods 2019-03-29 14:09:06 -04:00
Matthew Brown
dd7596ea64
Update title 2019-03-29 00:06:40 -04:00
bugreportuser
976c2c5ef3 Add an error for throws in global scope 2019-03-24 23:03:37 -04:00
Tyson Andre
2e6a2f14ed Fix typos in psalm with codespell's dictionary 2019-03-24 23:01:20 -04:00
Matthew Brown
9f7f7074ef
Add index to readme 2019-03-20 11:49:17 -04:00
Matthew Brown
41f0034185
Delete index.md 2019-03-20 11:48:20 -04:00
Matthew Brown
12b5d05a86
Update and rename introduction.md to README.md 2019-03-20 11:35:55 -04:00
Matthew Brown
b6d0f89d52
Fix typo 2019-03-19 22:40:27 -04:00
Matthew Brown
6f9945cc09
Change name 2019-03-19 22:39:42 -04:00
Matthew Brown
a8f9885021
Add introduction 2019-03-19 22:39:14 -04:00
Matthew Brown
60504f6c7b
Separate intro 2019-03-19 22:37:26 -04:00
Matthew Brown
41fe05277a
Add explanation of what Psalter does 2019-03-19 19:47:49 -04:00
Matthew Brown
d1f3a757aa
Put fixing on a new line 2019-03-19 18:38:11 -04:00
Matthew Brown
cf10e5b764
Improve index 2019-03-19 18:37:39 -04:00
Matthew Brown
86fecc3ecf
Add link for docblock type syntax 2019-03-19 17:12:35 -04:00
Matthew Brown
8201a2c65c
Add not to make clear you can use object-like arrays yourself 2019-03-19 15:29:28 -04:00
Matthew Brown
d55bd8ac65
Remove formatting that mkdocs doesn't recognise 2019-03-19 15:18:22 -04:00
Matthew Brown
336a79336f
Made indentation clearer maybe? 2019-03-19 15:12:08 -04:00
Matthew Brown
aaa1f17e52
Remove typing arrays 2019-03-19 14:08:58 -04:00
Matthew Brown
d13560f4ef
Add docblock type syntax reference 2019-03-19 13:55:55 -04:00
Matthew Brown
b8b6bf06d7
Add detailed breakdown of supported types 2019-03-19 13:54:36 -04:00
Matthew Brown
6748e5240c
Add follow on from installation 2019-03-19 12:08:22 -04:00
Matthew Brown
5f517f7055
Remove info 2019-03-19 12:02:49 -04:00
Matthew Brown
5d8e0b5036
Add s 2019-03-19 12:02:24 -04:00
Matthew Brown
5cf2cdbf76
Change version reqs 2019-03-19 12:02:12 -04:00
Matthew Brown
a62287ce61
Remove code 2019-03-19 11:54:08 -04:00
Matthew Brown
94ab35da97
Improve plugins page 2019-03-19 11:21:31 -04:00
Matthew Brown
472ab29d74 Add PossiblyInvalidCast for more refined checks 2019-03-17 17:10:51 -04:00
Brown
b3a59d2638 Fix #1435 - prevent classes extending interfaces 2019-03-07 11:16:40 -05:00
Brown
bd372e93af Add config flags for findUnusedVariables and findUnusedCode 2019-03-05 15:45:09 -05:00
Matthew Brown
cdae79b9fe Fix unnecessary params in Psalm codebase 2019-02-23 11:31:33 -05:00
Brown
3deea3980d Add checks for unitialized properties
Fixes #1328
2019-02-13 13:32:19 -05:00
Jacob Dreesen
d4b318faf9 Fix XML node name in the docs 2019-02-12 17:47:02 -05:00
Jacob Dreesen
59ed1c5327 Fix typo 2019-02-12 17:46:26 -05:00
Bruce Weirdan
c310a2dd86 Update docs/templated_annotations.md
Co-Authored-By: SignpostMarv <me@signpostmarv.name>
2019-02-11 18:39:19 -05:00
SignpostMarv
c3f8285eed adjusting header depth to reflect separate document 2019-02-11 18:39:19 -05:00
SignpostMarv
634c480dce splitting templated docs as per discussion in #1323 2019-02-11 18:39:19 -05:00
SignpostMarv
04815f160e stripping trailing whitespace 2019-02-11 18:39:19 -05:00
SignpostMarv
e0c610b75a shifting link to sub-section as per discussion in #1323 2019-02-11 18:39:19 -05:00
SignpostMarv
cfa8844cec updating link 2019-02-11 18:39:19 -05:00
SignpostMarv
c66802c2fa creating sub-section for using psalm
creating sub-section for using psalm alongside entry for psalter
2019-02-11 12:08:29 -05:00
SignpostMarv
3986e34c3c linking all docs in index for ease-of-discovery
further to my earlier tweet about searching for things in the psalm docs, just linking up a few of the unlinked docs.
2019-02-11 12:08:29 -05:00
Bruce Weirdan
1b20d9ab57 Added example of psalm --init run
Refs #1312
2019-02-10 20:40:16 -05:00
Matthew Brown
c58100e3af Fix #1313 - don’t allow mixed function calls 2019-02-10 16:15:52 -05:00
Matthew Brown
652b6eb8f2
Fix int|string return 2019-02-05 17:08:47 -05:00
Matthew Brown
eb070a0959 Put tag on newline 2019-02-05 14:01:36 -05:00
Matthew Brown
18684bb0d4 Add a couple of small edits 2019-02-05 14:01:36 -05:00
SignpostMarv
6c9076b101 adding doc blurb about template tag re-use, with example employing something other than a key-value pair type, using https://getpsalm.org/r/43d8b85bc4 2019-02-05 14:01:36 -05:00
SignpostMarv
deb85c3cf9 adding doc blurb about template tag order in reference to https://mobile.twitter.com/psalmphp/status/1092573808622485504 2019-02-05 14:01:36 -05:00
Tyson Andre
6ae2ee809c Fix typos in issues.md
Detected by codespell and LanguageTool.
2019-02-04 09:57:02 -05:00
Bruce Weirdan
a8799c5167 Converted list to sections
This allows to link to specific settings.
2019-02-03 14:28:47 -05:00
Matthew Brown
836d3d1528
Added more robust templating section 2019-01-29 23:26:37 -05:00
Brown
fcc9d1a979 Fix #1244 and fix #1243 - add template-extends checks 2019-01-25 15:31:17 -05:00
Matthew Brown
262ba9bdec
Added new LSP features. 2019-01-25 11:32:17 -05:00
Brown
cd0a7441d9 Add warnings for extended template param counts off 2019-01-24 17:55:03 -05:00
Matthew Brown
279912cb55 Add documentation for @param-out 2019-01-20 12:50:47 -05:00
Viktor Szépe
f6a00011be Fix config link in docs 2019-01-19 16:02:08 -05:00
Matthew Brown
bd9f2ec546 Add separate issue type for undefined interface method 2019-01-13 13:07:53 -05:00
Matthew Brown
8ab5fae484 Add function casing example plugin 2019-01-07 09:34:16 -05:00
Matthew Brown
195cb289ed Add float-checking plugin, and support for custom plugin issues 2019-01-07 08:38:56 -05:00
Matthew Brown
214fd7d461 Add DuplicateFunction issue
Fixes #49
2019-01-06 16:40:44 -05:00
Matthew Brown
b081256f39
Add section on using a baseline 2019-01-03 08:58:54 -05:00
Matthew Brown
6480b69db4
Update ALE info 2019-01-03 07:25:14 -05:00
Matthew Brown
6af3345b72
Fixed documentation about loops 2019-01-03 06:47:10 -05:00
Brown
2b4b55fd33 Add support for @return no-return
Fixes #1155
2019-01-02 17:05:39 -05:00
Matthew Brown
2304ad23b9
Added more info about class strings 2019-01-02 14:20:04 -05:00
Matthew Brown
a74c0c86ca
Add link to type manual 2019-01-02 13:56:43 -05:00
Brown
1d300ec342 Fix #1150 2019-01-02 11:18:22 -05:00
Andrii Dembitskyi
2162144234 Fix link in docs to example echo plugin 2019-01-01 18:43:15 +01:00
Brown
fb848d62e9 Add checks for if (count($a)) and if (count($a) [operator] [number]) 2018-12-19 16:15:19 -05:00
Matthew Brown
ea89a6ba29 Revert "First pass"
This reverts commit 9ed047234f.
2018-12-19 08:45:14 -05:00
Matthew Brown
9ed047234f First pass 2018-12-19 01:59:14 -05:00
Matthew Brown
b32000fa05 Fix #689 - add checks for @internal annotations 2018-12-01 18:37:49 -05:00
Matthew Brown
23fe4b3591
Add breaks 2018-11-30 19:01:24 -05:00
Matthew Brown
d3826e42c8
Adding a file to document the complicated things in life 2018-11-30 19:00:55 -05:00
Aidan Woods
10931d2d68 Fix config option typo 2018-11-24 11:19:46 -05:00
Tyson Andre
951e28d608 Fix typos noticed in docs 2018-11-15 21:54:25 -05:00
Matthew Brown
695f37e6c8
Add detail to ALE linter 2018-11-13 15:28:39 -05:00
Brown
06974221df Change DependencyFinderVisitor name to ReflectorVisitor and update docs 2018-11-13 14:09:43 -05:00
Bruce Weirdan
a338e76ef6 Plugin interface segregation (#1076)
* Split Plugin into PluginApi\Hook\* interfaces

* dropped Psalm\Plugin

* updated docs

* s/PluginApi/Plugin/g
2018-11-12 11:20:59 -05:00
Matthew Brown
8b0f2579a5 Update plugin docs 2018-11-12 11:20:59 -05:00
Bruce Weirdan
052d4f6217 Plugin loading (#855)
* add ability to load plugins by class names

- Plugins need to implement `__invoke(PluginFacade $psalm):void` method
- Plugins are enabled by adding `<pluginClass
class="Qualified\Class\Name"/>`
- `PluginFacade` provides a single point of contact with Psalm, so that
plugins cannot become coupled to Psalm internals

* added `psalm-plugin` cli tool to manage plugins

Available commands:
 `psalm-plugin list` - lists available and enabled plugins
 `psalm-plugin enable 'Plugin\Class\Name'` - enables plugin (modifies `psalm.xml`)
 `psalm-plugin disable 'Plugin\Class\Name'` - disables plugin (modifies `psalm.xml`)

Plugin installation:
 `composer install plugin-vendor/plugin-package-name`

Plugin authoring:
 Plugins are identified by package `type` field, which should contain
 `psalm-plugin` string.
 `extra.pluginClass` should refer to the name of the class implementing
 `__invoke(PluginFacade $psalm):void` function

Todo:
 - better config file search
 - better output for `psalm-plugin`
 - better formatting for modified xml file
 - composer skeleton project for plugins
 - ability to refer to plugins by package name (cli only)
 - composer plugin to (optionally) enable plugin upon installation
 - documentation on plugin installation and authoring
 - interfaces for plugin dependencies
 - interface for plugin entry point
 - migration path for legacy plugins

* documented previously undocumented plugin methods

* split legacy plugin registration into a wrapper class

also added `PluginApi` namespace and `RegistrationInterface`

* reuse psalm's config search algorithm

* enable/disable plugins by composer package name

* allow specifying alternative config file name

* whitelist PluginApi namespace

three times, but well, it works now

* interface for plugin entry points

* psalm-plugin as a symfony console app

* fixed errors found by psalm

* suppressed false positive UnusedMethods

* cs fix

* better psalm-plugin output

* don't leave empty `plugins` node to avoid old schema violation

* removed junk file that shouldn't be there

* cs fix

* fixed phpunit failure (constant redefinition)

* work around missing docblock in on symfony console

* php 7.0 compatibility

* allow `pluginClass` child elements as plugin configuration

* decouple console commands from undelying implementation

- introduce PluginListFactory
- add `PluginList::enable(string $class)` and `PluginList::disable(string $class)`

* PluginList tests

* ComposerLock test

* droppped debugging statement

* added part of console command tests

* added tests for EnableCommand

* added DisableCommand tests

* ignore unused args

* ConfigFile test

* disable travis cache in attempt to fix builds

* nah, that didn't work

* update for upstream changes

* rebase fixes

* namespaced `extra` entry for entry point

* s/PluginFacade/PluginRegistrationSocket/g

* Added $config parameter to PluginEntryPointInterface::__invoke()

* cs fixes

* entry point interface php7.0 compatibility

* cleaned up old cruft

- dropped todos I'm not going to pursues
- locked entry point to be a class implementing entry point interface

* fixed legacy plugins docs

* Added RegistrationInterface::registerHooksFromClass()

It mimics the way old plugins were registered in Psalm\Config, so
handler classes extending Psalm\Plugin should be fully compatible with
it.

Since Psalm\Plugin-style plugin registration was moved to
RegistrationSocket, LegacyPlugin now only load file-based plugins, so it
was renamed to FileBasedPluginAdapter.

* Converted EchoChecker plugin to composer-based format

- Its subfolder is registered as a local composer package in the root
composer.json, so it's directly installable with
	```
	composer require psalm/echo-checker-plugin
	```
- Migration is trivial: drop the plugin into a separate folder, then add
simple composer.json and the entry point class.

* Updated docs

* Don't reject hook handlers that inherit handling methods

* strip void return type in stub file
2018-11-10 23:23:36 -05:00