What is PHPStan why it is essential in quality php projects? Read more here. You can use out of the box PHPStan via CLI. After setup in you IDE, you can use PHPStan in your IDE too.
# as always all CLI commands should be run in the php docker container. (docker exec -it symfony-react-skeleton_php sh -l)
composer phpstan
# or
composer test
Yes, you can use PHPStan to see static php errors in your PhpStorm.
- Go to File | Settings | PHP | Quality Tools and click "PHPStan"
- Click on "...", check PHPStan path:
/your/path/to/repo/api/vendor/bin/phpstan
and click on "validate" - You should see something like
OK, PHPStan - PHP Static ...
- Click on "OK"
- Switch button from OFF to ON
- Enter Configuration file:
/your/path/to/repo/api/phpstan.neon
- Click on "OK"
You can now see all static php errors in your IDE