Configured GrumPHP with bunch of tools for static code analysis Symfony Framework
symfony-grumphp
is configured GrumPHP with bunch of tools for static code analysis mainly based on PSRs and Symfony Coding Standards for Symfony Framework projects.
phpro/grumphp
sebastian/phpcpd
friendsofphp/php-cs-fixer
php-parallel-lint/php-parallel-lint
phpmd/phpmd
phpstan/phpstan
phpstan/phpstan-doctrine
phpstan/phpstan-phpunit
phpstan/phpstan-symfony
thecodingmachine/phpstan-strict-rules
symfony/phpunit-bridge
enlightn/security-checker
PHP needs to be a minimum version of PHP 7.3.
Symfony Framework needs to be a minimum version of Symfony Framework 4.0 or 5.0.
To install symfony-grumphp
, install Composer, execute the following command:
composer require --dev sci3ma/symfony-grumphp
and create (or update) configuration files:
./vendor/bin/symfony-grumphp install
You can, and perhaps you should, check and customize all configured tasks in grumphp.yml
file in project root folder.
GrumPHP should be enabled by default but you can also enable GrumPHP yourself:
./vendor/bin/grumphp git:init
or disable GrumPHP:
./vendor/bin/grumphp git:deinit
You can find more GrumPHP configuration here.
If you need to test code that interact with the database you need to instal dama/doctrine-test-bundle
:
composer require --dev dama/doctrine-test-bundle
and uncomment extension <extension class="DAMA\DoctrineTestBundle\PHPUnit\PHPUnitExtension" />
in phpunit.xml.dist
.
Read more about how to Test Code that Interacts with the Database
If you want to uninstall this library remove configuration files first:
./vendor/bin/symfony-grumphp uninstall
then remove package:
composer remove sci3ma/symfony-grumphp
You can run tests/checks our code without commit manually:
./vendor/bin/grumphp run