mirror of
https://github.com/composer/composer
synced 2025-05-10 09:02:59 +00:00
plugins: mention static analysis support (#10812)
This commit is contained in:
parent
cb76394800
commit
ab9e18027e
2 changed files with 26 additions and 0 deletions
|
@ -339,6 +339,25 @@ depend on other packages can function correctly, a runtime autoloader is created
|
|||
a plugin is loaded. That autoloader is only configured to load with the plugin dependencies,
|
||||
so you may not have access to all the packages which are installed.
|
||||
|
||||
## Static Analysis support
|
||||
|
||||
As of Composer 2.3.7 we ship a `phpstan/rules.neon` PHPStan config file, which provides additional error checking when working on Composer plugins.
|
||||
|
||||
### Usage with [PHPStan Extension Installer][13]
|
||||
|
||||
The necessary configuration files are automatically loaded, in case your plugin projects declares a dependency to `phpstan/extension-installer`.
|
||||
|
||||
### Alternative manual installation
|
||||
|
||||
To make use of it, your Composer plugin project needs a [PHPStan config file][12], which includes the `phpstan/rules.neon` file:
|
||||
|
||||
```
|
||||
includes:
|
||||
- vendor/composer/composer/phpstan/rules.neon
|
||||
|
||||
// your remaining config..
|
||||
```
|
||||
|
||||
[1]: ../04-schema.md#type
|
||||
[2]: ../04-schema.md#extra
|
||||
[3]: https://github.com/composer/composer/blob/main/src/Composer/Plugin/PluginInterface.php
|
||||
|
@ -350,3 +369,5 @@ so you may not have access to all the packages which are installed.
|
|||
[9]: https://github.com/composer/composer/blob/main/src/Composer/Plugin/Capability/CommandProvider.php
|
||||
[10]: https://symfony.com/doc/current/components/console.html
|
||||
[11]: https://github.com/composer/composer/blob/main/src/Composer/Util/SyncHelper.php
|
||||
[12]: https://phpstan.org/config-reference#multiple-files
|
||||
[13]: https://github.com/phpstan/extension-installer#usage
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue