Lint PHP files faster by running several lint processes at once
open sourceMITfree
PHPLint is a command-line tool that checks PHP files for syntax errors faster than running php -l on each file, by running several lint processes in parallel. It runs from the console, in Docker or in CI, and can be used programmatically, with a YAML configuration file for paths, exclusions and options. Install it as a PHAR from its GitHub releases (the recommended way), with Phive, with Composer (overtrue/phplint) or from the overtrue/phplint Docker image. Version 9 is a full rewrite for PHP 8.x; Laurent Laville has maintained it since 9.0.
Problems it solves
- php -l on every file in CI takes too long on a big PHP codebase
- catch PHP syntax errors before deploy in a GitHub Actions pipeline
- lint PHP files in parallel from a Docker image
Features
- parallel PHP syntax linting
- YAML configuration
- PHAR, Phive, Composer and Docker installs
- CI and programmatic use
Limitations
- Needs PHP 8.2 or newer for the supported 9.7 and 9.8 versions; older PHP needs an end-of-life release.1
Alternatives
The same job
These do what PHPLint does.
- PHP Parallel Lint Checks the syntax of PHP files in parallel
- Super-Linter Ready-to-run collection of linters and formatters as a GitHub Action or container
- Easy Coding Standard (ECS) Runs PHP_CodeSniffer and PHP-CS-Fixer rules together, fast
- Hadolint Dockerfile linter that checks best practices and the shell in RUN lines
- PHP_CodeSniffer Detect and fix coding standard violations in PHP
- PHPCompatibility PHP_CodeSniffer sniffs that check PHP code for cross-version compatibility
