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

135 Commits

Author SHA1 Message Date
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