Download the PHP package aretche/php-code-quality without Composer
On this page you can find all versions of the php package aretche/php-code-quality. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aretche/php-code-quality
More information about aretche/php-code-quality
Files in aretche/php-code-quality
Package php-code-quality
Short Description Code Quality scripts that can be run via Composer in Symfony projects. (forked from karriere/code-quality)
License Apache-2.0
Informations about the package php-code-quality
Code Quality for PHP packages
This package provides code quality scripts that can be run via Composer.
The scripts also work on continous integration (CI) servers like Jenkins.
Used packages
FriendsOfPHP/PHP-CS-Fixer
Currently used for fixing the code.
Fixes all files in src directory according Symfony coding guidelines.
This package is not used for checking (linting), because PHP_Codesniffer prints a more readable output.
squizlabs/PHP_CodeSniffer
Currently used for checking (linting) the code.
Sniffs all files in src directory.
This package could also be used for fixing, but PHP-CS-Fixer does it better.
phpmd/phpmd
Used for mess detection.
Runs the defined ruleset (config/phpmd.xml) on all files in src directory.
phpstan/phpstan
Used for static analysis.
Perform static analysis on all files in src directory.
phpunit/phpunit
Used for testing the code.
Must be configured with a phpunit.xml file in your root folder.
lchrusciel/api-test-case
Based on PHPUnit and used for testing API methods.
phpspec/phpspec
Used for testing (SpecBDD) the code.
Must be configured with a phpspec.yml file in your root folder.
We are using the leanphp/phpspec-code-coverage extension for generating coverage reports.
This extension requires a phpspec-coverage.yml file in your root folder and Xdebug enabled.
Installation
Run composer require --dev aretche/php-code-quality to install this package.
After installing, insert the desired scripts to your composer.json.
Usage
You can run a script like this: composer {script} -- {options}.
If you are using Git-Shell on Windows (or Git-Shell in Intellij Terminal on Windows), call scripts like this:
composer.bat {script}. Otherwise colors will not work.
You can disable TTY by adding the --notty flag (needed for Jenkins).
On Windows platform it's disabled automatically.
Scripts
lint
static
md
fix
unit-test
unit-coverage
check-coverage
spec-test
spec-coverage
Using custom matchers
This package integrates karriere/phpspec-matchers.
In order to use the custom matchers defined in this package,
please include the extension configuration in your phpspec.yml.
FAQ
Why do I have to provide two phpspec configuration files?
The code-coverage-extension slows down the phpspec tests, so we excluded it from the normal configuration file. Keep tests fast!
How do I increase the verbosity of the test-script output?
Run composer test -- -v.
All versions of php-code-quality with dependencies
squizlabs/php_codesniffer Version ^3.5
friendsofphp/php-cs-fixer Version ^2.16
phpmd/phpmd Version ^2.7
phpstan/phpstan Version ^0.11.19
phpstan/phpstan-doctrine Version ^0.11.6
phpstan/phpstan-symfony Version ^0.11.6
karriere/phpspec-matchers Version ^3.0
friends-of-phpspec/phpspec-code-coverage Version ^4.3
phpspec/phpspec Version ^5.0
phpunit/phpunit Version ^6.0|^7.0
lchrusciel/api-test-case Version ^3.1
symfony/console Version ^3.2 || ^4.0
symfony/process Version ^3.2 || ^4.0