Add PHPStan sections in docs (#20504)

This commit is contained in:
Maksim Spirkov
2025-08-29 18:36:36 +05:00
committed by GitHub
parent 2fc017b6bc
commit c4e920f054
2 changed files with 25 additions and 0 deletions

View File

@ -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: