This tool check syntax of PHP files about 20x faster than serial check.
This application checks syntax of PHP files in parallel.
It can output in plain text, colored text, json and checksyntax formats.
blame can be used to show commits that introduced the breakage.
Running parallel jobs in PHP is inspired by Nette framework tests.
The application is officially supported for use with PHP 5.3 to 8.1.
- Example output
- Command line options
- Recommended excludes for Symfony framework
- How to upgrade
composer as development dependency:
composer require --dev php-parallel-lint/php-parallel-lint
Alternatively you can install as a standalone
composer create-project php-parallel-lint/php-parallel-lint /path/to/folder/php-parallel-lint /path/to/folder/php-parallel-lint/parallel-lint # running tool
For colored output, install the suggested package
composer require --dev php-parallel-lint/php-console-highlighter
Since v1.3.0, a PHAR file is also made available for each release. This PHAR file is published as an asset for each release and can be found on the Releases page.
Since then, Jakub has moved on to other interests and as of January 2020, the second most active maintainer @grogy has taken over maintenance of the project and given the project - and related dependencies - a new home in the PHP Parallel Lint organisation.
It is strongly recommended for existing users of the (unmaintained) jakub-onderka/php-parallel-lint package to switch their dependency to php-parallel-lint/php-parallel-lint, see How to upgrade below.
-p <php>Specify PHP-CGI executable to run (default: 'php').
-s, --shortSet short_open_tag to On (default: Off).
-a, --aspSet asp_tags to On (default: Off).
-e <ext>Check only files with selected extensions separated by comma. (default: php,php3,php4,php5,phtml,phpt)
--excludeExclude a file or directory. If you want exclude multiple items, use multiple exclude parameters.
-j <num>Run jobs in parallel (default: 10).
--colorsForce enable colors in console output.
--no-colorsDisable colors in console output.
--no-progressDisable progress in console output.
--checkstyleOutput results as Checkstyle XML.
--jsonOutput results as JSON string (requires PHP 5.4).
--gitlabOutput results for the GitLab Code Quality widget (requires PHP 5.4), see more in Code Quality documentation.
--blameTry to show git blame for row with error.
--git <git>Path to Git executable to show blame message (default: 'git').
--stdinLoad files and folder to test from standard input.
--ignore-failsIgnore failed tests.
--syntax-error-callbackFile with syntax error callback for ability to modify error, see more in example
-h, --helpPrint this help.
-V, --versionDisplay this application version.
To run from the command line:
vendor/bin/parallel-lint --exclude app --exclude vendor .
Are you using
jakub-onderka/php-parallel-lint package? You can switch to
composer remove --dev jakub-onderka/php-parallel-lint composer require --dev php-parallel-lint/php-parallel-lint