sci3ma / symfony-grumphp
Configured GrumPHP with bunch of tools for static code analysis Symfony Framework
Installs: 6 549
Dependents: 1
Suggesters: 0
Security: 0
Stars: 17
Watchers: 2
Forks: 4
Open Issues: 1
Requires
- php: ^7.3|^8.0
- composer/composer: ^2.0
- enlightn/security-checker: ^1.5
- friendsofphp/php-cs-fixer: ^2.18
- php-parallel-lint/php-parallel-lint: ^1.2
- phpmd/phpmd: ^2.9
- phpro/grumphp: ^1.3
- phpstan/phpstan: ^0.11.2|^0.12.26
- phpstan/phpstan-doctrine: ^0.11.1|^0.12.0
- phpstan/phpstan-phpunit: ^0.11.0|^0.12.0
- phpstan/phpstan-symfony: ^0.11.1|^0.12.0
- psr/event-dispatcher: ^1.0
- sebastian/phpcpd: ^6.0
- symfony/console: ^4.0|^5.0
- symfony/filesystem: ^4.0|^5.0
- symfony/phpunit-bridge: ^4.0|^5.0
- thecodingmachine/phpstan-strict-rules: ^0.11.2|^0.12.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-23 00:56:08 UTC
README
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.
Included tools
- GrumPHP:
phpro/grumphp
- PhpCpd:
sebastian/phpcpd
- PHP-CS-FIXER:
friendsofphp/php-cs-fixer
- PHPLint:
php-parallel-lint/php-parallel-lint
- PhpMd:
phpmd/phpmd
- PHPStan:
phpstan/phpstan
- Doctrine extension:
phpstan/phpstan-doctrine
- PHPUnit extension:
phpstan/phpstan-phpunit
- Symfony Framework extension:
phpstan/phpstan-symfony
- TheCodingMachine's additional rules:
thecodingmachine/phpstan-strict-rules
- Doctrine extension:
- PHPUnit Bridge:
symfony/phpunit-bridge
- With Clover Coverage and percentage code coverage check
- Enlightn Security Checker:
enlightn/security-checker
Requirements
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.
Installation
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
Configuration
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.
Test code with the database
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
Uninstall
If you want to uninstall this library remove configuration files first:
./vendor/bin/symfony-grumphp uninstall
then remove package:
composer remove sci3ma/symfony-grumphp
Force run
You can run tests/checks our code without commit manually:
./vendor/bin/grumphp run