mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-27 20:06:19 +08:00
Add PHPStan sections in docs (#20504)
This commit is contained in:
@ -73,6 +73,18 @@ You may limit the tests to a group of tests you are working on e.g. to run only
|
||||
|
||||
You can execute JavaScript unit tests by running `npm test` in the repo root directory.
|
||||
|
||||
### Static analysis
|
||||
|
||||
We use [PHPStan](https://phpstan.org) for static analysis. It can be launched using the following commands:
|
||||
`php vendor/bin/phpstan` or `vendor\bin\phpstan.bat` in case of execution from the Windows OS.
|
||||
|
||||
By default, PHPStan will use the configuration from `phpstan.dist.neon`. You can create
|
||||
a `phpstan.neon` file with your own configuration, and PHPStan will use it.
|
||||
|
||||
#### Note
|
||||
|
||||
In PHPDoc annotations, we use standard PHP types. Please use PHPStan/Psalm annotations if you want to add conditional types, array shapes, etc. This is because not all IDEs currently support PHPStan/Psalm types, and it will also break automatic documentation generation.
|
||||
|
||||
### Extensions
|
||||
|
||||
To work on extensions you have to clone the extension repository. We have created a command that can do this for you:
|
||||
|
||||
Reference in New Issue
Block a user