Skip to content

PHPStan🔗

Why ?🔗

Because sometimes only having php-cs-fixer dont tell us if we made mistakes in our codes

Installation🔗

1
composer require phpstan/phpstan

Create / Copy the phpstan.neon.dist file provided here

Usage🔗

Add the following target in your Makefile

1
2
3
4
5
lint.phpstan: export APP_ENV = test
lint.phpstan:
    bin/console cache:clear --ansi
    bin/console cache:warmup --ansi
    vendor/bin/phpstan analyse

You need to clear & warmup the cache before running phpstan, as it need knowledge about your services definitions.

Extension used🔗


Last update: December 20, 2024