1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
Commit Graph

207 Commits

Author SHA1 Message Date
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
Tyson Andre
6ba76e1589 Fix wording nits in documentation 2018-10-27 13:05:49 -04:00
Matthew Brown
f8b213bb48
Add line break 2018-10-25 13:31:04 -04:00
Matthew Brown
4be2e77dfa
Update ALE info 2018-10-25 13:30:37 -04:00
Brown
4ae218fdea Format list properly 2018-10-23 18:31:49 -04:00
Brown
c6f00c07e1 Improve formatting 2018-10-23 17:46:05 -04:00
Brown
93ce245767 Capitalise editors 2018-10-23 17:37:48 -04:00
Brown
09ebb2857f Turn urls into links 2018-10-23 17:35:42 -04:00
Brown
68786b1698 Add link to language server doc 2018-10-23 17:30:36 -04:00
Brown
fc72ac05e4 Add VS Code requirement 2018-10-23 17:27:11 -04:00
Brown
eac28d4291 Add note about new PR 2018-10-23 16:55:07 -04:00
Brown
9ee7b9a1a1 Update VS Code support 2018-10-23 16:52:53 -04:00
Brown
3ca53d4435 Improve formatting of PHPStorm settings 2018-10-23 11:21:32 -04:00
Brown
6e529da5c1 Fix link 2018-10-23 11:20:30 -04:00
Brown
0a3f8d152d Fix PHPStorm instructions 2018-10-23 11:19:27 -04:00
Brown
bb81bbde6d Improve emacs LSP code 2018-10-23 10:20:31 -04:00
Matthew Brown
a1b277869b
Fix name 2018-10-22 11:58:53 -04:00
Brown
6af3a226c4 Add docs for language server support 2018-10-19 17:51:07 -04:00
Tyson Andre
e0dda676ed nit: Fix return type in docs/supported_annotations.md 2018-10-18 17:21:32 -04:00
Dave Liddament
af149bd4dc ADD extra documentation about psalm-assert
Maybe this will be obvious to others, but it probably took me about 3 hours to realise this was possible. Hopefully this doc update will save others time too.
2018-10-11 15:54:37 -04:00
Matthew Brown
afebefba19 Switch from --cache-results to --diff-methods flag 2018-10-07 00:42:25 -04:00
Matthew Brown
265157d814
Add a note about using threads 2018-09-30 16:05:42 -04:00
Matthew Brown
04f78771b5 Add section about running faster builds 2018-09-30 11:34:51 -04:00
Matthew Brown
890412b557 Add support back for parser errors 2018-09-30 11:34:51 -04:00
Matt Brown
4d4e84e6e9 Add specific ForbiddenEcho issue if a config flag is set 2018-09-18 17:08:32 -04:00
Matt Brown
cb63f4f70f Add support for checking DeprecatedTrait and DeprecatedConstant 2018-08-10 13:25:25 -04:00
Tyson Andre
06abf52d94 Fix typos detected by misspell (#924)
Both of initiali[sz]e were used, z was more common.
2018-08-02 00:40:51 -04:00
Tyson Andre
9b7ca80fa4 nit: fix typo in docs (#917)
https://www.vocabulary.com/dictionary/parenthesis
2018-07-24 16:56:51 -04:00
Matthew Brown
e3ae1bf26f Fix #15 - check for uncaught throws if config flag is set 2018-06-22 01:13:49 -04:00
Matthew Brown
896790d30c Add documentation for recently-added features 2018-06-20 00:33:32 -04:00
Matthew Brown
bec227fbc2
Added description of ignoreFiles directive 2018-06-07 13:37:54 -04:00
Matthew Brown
c4f3bd1558 Add docs for @psalm-assert annotations 2018-06-03 23:38:06 -04:00
Matthew Brown
b5cb2b34a2 Fix #380 - don’t complain about legitimate (if archaic) self calls 2018-06-03 19:11:07 -04:00
Alexey Kopytko
185877276c Update dealing_with_code_issues.md (#780) 2018-05-30 07:08:15 -04:00
Matt Brown
2d6eab85fa Fix doc example syntax 2018-05-24 14:33:41 -04:00
Matt Brown
e2153db3dc Add more info to typing guidelines 2018-05-24 14:31:55 -04:00
Matt Brown
bc17d23788 Fix mixed empty checks 2018-05-08 16:34:08 -04:00
Matt Brown
c0729a02cd Fix remaining issues with logic checks 2018-05-07 14:52:45 -04:00
Matt Brown
383f706d6b Add docs for usePhpDocMethodsWithoutMagicCall 2018-04-26 19:19:35 -04:00
rightfold
5c908da55a Check that __clone, __construct, __destruct signatures omit return types
PHP complains when you have a return type declared for these three methods.
2018-04-21 16:04:03 -04:00
Matthew Brown
2b34c1d315 Add extra level 8 containing PHP autoload landmines 2018-04-19 01:03:28 -04:00