What is PHP_CodeSniffer why it is essential in quality php projects? Read more here. You can use out of the box PHP_CodeSniffer via CLI. After setup in you IDE, you can use PHP_CodeSniffer 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 phpcs
# or
composer test
Yes, you can use PHP_CodeSniffer 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/phpcs
and click on "validate" - You should see something like
OK, PHP_CodeSniffer version ...
- Click on "OK"
- Switch button from OFF to ON
- Select Custom for Coding standard select
- Enter Configuration file:
/your/path/to/repo/api/phpcs.xml.dist
- Click on "OK"
You can now see all static php errors in your IDE