Laravel Pint
Opinionated PHP code style fixer for Laravel — a zero-configuration wrapper around PHP-CS-Fixer that enforces Laravel coding standards. Pint features: `./vendor/bin/pint` fixes all PHP files in project, `--test` flag checks without fixing (CI mode), preset selection (laravel, psr12, symfony), custom rule configuration in pint.json, `--dirty` flag for only git-modified files, `--path` for specific files, and GitHub Actions integration. Included by default in new Laravel projects. Enforces: single quotes, trailing commas, type declaration ordering, blank line standards, import sorting, and 50+ Laravel-specific rules. Replaces manual PHP-CS-Fixer configuration with Laravel-community-approved defaults.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Local CLI tool — no network access, no security concerns beyond dependency supply chain. Ensure composer.lock pins Pint version to prevent unexpected rule changes from silent upgrades affecting agent CI.
⚡ Reliability
Best When
You're working on a Laravel agent project and want automatic, zero-configuration PHP code style enforcement matching Laravel community standards.
Avoid When
You need custom complex style rules beyond PHP-CS-Fixer rule configuration, or you're in a non-Laravel PHP project.
Use Cases
- • Agent project code style enforcement — ./vendor/bin/pint run in pre-commit hook or CI ensures consistent PHP formatting across agent codebase; no pint.json needed for Laravel-standard agent projects
- • CI code style check — ./vendor/bin/pint --test exits with non-zero code if fixes needed; GitHub Actions step fails PR if agent PHP code doesn't meet style standards without modifying files
- • Custom agent style rules — pint.json with { 'preset': 'laravel', 'rules': { 'ordered_class_elements': true } } extends Laravel preset with additional rules for agent codebase house style
- • Pre-commit staged file check — ./vendor/bin/pint --dirty lints only git-modified PHP files; faster than full project scan for pre-commit hooks in large agent codebases
- • Pint in GitHub Actions — actions/checkout + php-actions/composer + ./vendor/bin/pint --test workflow step blocks PR merge if agent PHP style violations detected in CI
Not For
- • Static analysis — Pint fixes style only; for type checking and bug detection in agent PHP code use PHPStan or Psalm
- • Non-PHP projects — Pint is PHP-specific; use ESLint/Prettier for JavaScript, Black for Python, Rubocop for Ruby
- • Non-Laravel PHP projects — Pint's laravel preset assumes Laravel conventions; for pure PHP projects use PHP-CS-Fixer directly with custom rules
Interface
Authentication
No auth — local CLI tool. Runs on local filesystem PHP files.
Pricing
Laravel Pint is MIT licensed, maintained by the Laravel team. Included free in Laravel 9+.
Agent Metadata
Known Gotchas
- ⚠ --test flag is required for CI — ./vendor/bin/pint without --test modifies files in place; CI/CD that runs pint without --test will modify files but the pipeline passes even with violations; always use --test flag in CI to check without modifying, fail on violation
- ⚠ pint.json rules override not merge — if pint.json specifies 'rules', it adds to preset rules; to disable a default rule, set it to false: { 'rules': { 'blank_line_before_statement': false } }; undocumented rule disabling causes agent teams to keep unwanted style fixes
- ⚠ Pint uses PHP-CS-Fixer rule names — pint.json rule keys are PHP-CS-Fixer fixer names (snake_case); not all PHP-CS-Fixer fixers are available; using unavailable fixer name causes 'The rule ... is not defined' error for agent custom rule configuration
- ⚠ PHP version matters for rules — some Pint rules require specific PHP version (nullsafe operators, match expressions); running Pint with PHP 7.4 on PHP 8.1 agent code applying PHP 8.x rules causes parse errors; ensure Pint runs with same PHP version as agent application
- ⚠ --dirty only checks git-tracked changed files — untracked new files are not checked by --dirty; agent developers adding new PHP files without git add may skip Pint check; use --path for explicit file targeting in pre-commit hooks to catch new agent service files
- ⚠ Pint modifies files without backup — runs in-place; if agent code has syntax errors, Pint may produce malformed output; always run in git repository where changes can be reverted; don't run Pint on generated agent code that shouldn't be human-formatted
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Laravel Pint.
Scores are editorial opinions as of 2026-03-06.