This development tool provides a pre-defined configuration for GrumPHP with the following checks enabled:
- Security Checker (sensiolabs/security-checker),
- composer.json validation,
- composer.json normalization (ergebnis/composer-normalize),
- YAML Lint,
- JSON Lint,
- PHP Lint (php-parallel-lint/php-parallel-lint),
- PHP CS Fixer checks and fixes (PSR12 or some other custom ones),
- PHP Stan (PHPStan)
The package provides a default configuration for each task, and it's customizable at will through a simple configuration file.
The package will install the required dependencies, so it works out of the box.
Tasks can be also added or skipped according to your need.
The following versions of PHP are supported:
- PHP 7.2
composer require agora/php-conventions --dev
Manually add to your composer.json
file
"extra": {
"grumphp": {
"config-default-path": "vendor/agora/php-conventions/config/grumphp.yml"
}
}
Edit the file grumphp.yml.dist
or grumphp.yml
and add on the top it:
imports:
- { resource: vendor/agora/php-conventions/config/grumphp.yaml }
To add an extra Grumphp task:
imports:
- { resource: vendor/agora/php-conventions/config/grumphp.yaml }
parameters:
extra_tasks:
infection: ~
skip_tasks:
- phpcsfixer
In conjunction with extra_tasks
, use skip_tasks
to skip tasks if needed.