Download the PHP package district09/qa-php without Composer
On this page you can find all versions of the php package district09/qa-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download district09/qa-php
More information about district09/qa-php
Files in district09/qa-php
Package qa-php
Short Description Quality Assurance tools and configuration for PHP projects and packages.
License MIT
Homepage https://github.com/digipolisgent/php_package_qa-php
Informations about the package qa-php
Quality Assurance - PHP
This package provides a set of Quality Assurance tools and configuration files for PHP projects and packages (libraries).
Requirements
Installation
Add the grumphp entry to the extra section of your composer.json.
Add the qa-php package as dev requirement:
Configuration
General
If required you can extend or override the provided configuration file of a task. Simply create the matching configuration file in the root of your project.
For example, to override the provided phpcs.xml file you can either create a
phpcs.xml or phpcs.local.xml file.
Note that the .local. files should only be used for changes that shouldn't be
committed. Exclude them in .gitignore:
Yaml and Neon files will extend (merged into) the provided configuration file by
default. Create a .env or .env.local file and add following contents to
change this behaviour:
Wherein [FILENAME] matches the configuration filename and [TYPE] is either:
LOCALto skip for example yourphpstan.local.neonfile.PROJECTto skip for example yourphpstan.neonfile.GLOBALto skip for example the by qa-php providedphpstan.neonfile.
Other file types cannot be merged and will just override all other less specific files.
PHPStan in deprecations only mode
Create a phpstan.neon file and add following contents to ignore everything
except deprecations:
Ignore automatically created config files
Some GrumPHP tasks require a config file. These are automatically created, from
the examples within vendor/qa-php/config or by the project specific files within
your project or package root directory. The generated files are also stored in
the same project/package root. You can recognize these files by the .qa-php.
suffix.
These files should not be committed! Add them to the .gitignore file:
Ignore PHPUnit build files
When the PHPUnit task runs, coverage report files are stored into the build
directory located in the root of your project. Add this file to the .gitignore
file:
Run PHPUnit locally without coverage
Running PHPUnit with coverage report is time consuming. You can locally speed up
PHPUnit by copying the generated phpunit.qa-php.xml file to
phpunit.local.xml and remove the <coverage> section from it.
Run GrumPHP
GrumPHP will automatically run all tasks on the changed code on git commit and push.
You can run all tasks at once:
Or you can run one or more specific tasks manually by running:
PHPStorm
PHPStorm requires config files for PHP_CodeSniffer, PHP Mess Detector & PhpUnit. Run the grumphp command at least once (successfully) to generate these files.
The files will be created as:
phpcs.qa-php.xml: PHP_CodeSniffer config file.phpmd.qa-php.xml: PHP Mess Detector config file.phpunit.qa-php.xml: PHPUnit config file.
Configure the paths to these files in PHPStorm:
- Editor > Inspections > PHP > Quality tools > PHP Mess Detector validation
Add
phpmd.qa-php.xmlto the "Custom rulesets". - Editor > Inspections > PHP > Quality tools > PHP_CodeSniffer validation
Set "Coding Standard" to "Custom" and set the path to
phpcs.qa-php.xml. - Languages & Frameworks > PHP > Test Frameworks > Test Runner
Set "Default configuration file" to
phpunit.qa-php.xml.
PHP compatibility
In order to check php compatibility you can use the phpcs PHPCompatibility sniff:
All versions of qa-php with dependencies
enlightn/security-checker Version ^1.4|^2.0
ergebnis/composer-normalize Version ^2.8
nette/neon Version ^3.2
phpcompatibility/php-compatibility Version ^9.3
phpmd/phpmd Version ^2.11
phpro/grumphp-shim Version ^2.0
phpspec/prophecy Version ^1.10
phpspec/prophecy-phpunit Version ^2.0
phpstan/phpstan Version ^1.0 || ^2.0
phpunit/phpunit Version ^9 || ^10 || ^11 || ^12
slevomat/coding-standard Version ^8.15
squizlabs/php_codesniffer Version ^3.5.6
symfony/filesystem Version ^5.2|^6.0|^7.0
systemsdk/phpcpd Version ^7.0 || ^8.0
phpstan/phpstan-deprecation-rules Version ^1.0 || ^2.0