overtrue/phplint
PHPLint is a fast PHP syntax linter that runs multiple lint processes in parallel to speed up checking large codebases. Supports modern PHP versions, with easy installation via Composer, PHAR, Docker, or Phive, and configurable rules and paths.
composer require --dev overtrue/phplint../vendor/bin/phplint src/ or ./vendor/bin/phplint to lint all PHP files in the current directory (and subdirectories)../vendor/bin/phplint --help to see options like --parallel or --no-progress.phplint on staged files. Example .pre-commit-config.yaml entry:
- repo: local
hooks:
- id: phplint
name: PHP Syntax Check
entry: vendor/bin/phplint
language: system
types: [php]
- name: Lint PHP files
run: vendor/bin/phplint --parallel
phplint as a step in composer scripts:
"scripts": {
"lint": "phplint src tests",
"lint:ci": "phplint --parallel --no-progress src tests"
}
--parallel (defaults to auto-detect cores) for faster checks on large monorepos—especially beneficial in CI where CPU cores are available.phplint returns 0 on success and 1 on any parse error or warnings—crucial for CI failure detection. Don’t ignore this in scripts..php files only. Use --extensions to override (e.g., --extensions=php,php4) if needed.--quiet in CI unless you capture raw output—errors won’t appear in logs otherwise. Prefer --no-progress instead for cleaner CI logs.pcntl_fork() may be disabled by default. Ensure pcntl is enabled if you see The process has been signaled with signal "11"—or explicitly disable parallel mode via --parallel=1.--exclude (e.g., --exclude=vendor,bootstrap/cache) to avoid false positives and speed up runs.phplint before tools like PHPStan or PHPCS—catching syntax errors early avoids cascading false positives downstream.How can I help you explore Laravel packages today?