ecphp/php-conventions
Predefined GrumPHP configuration for PHP projects at the European Commission. Adds quality checks via git hooks (or manual runs): license file, composer validation/normalization, linters (YAML/JSON/PHP), Twig CS, PHP-CS-Fixer, PHPCS, PHPStan, Psalm.
Installation
composer require --dev ecphp/php-conventions
Add to composer.json under require-dev if not using globally.
First Use Case Run the convention checker against a Laravel project:
./vendor/bin/php-conventions check src
Focus on the src directory (or app/ in Laravel) to avoid false positives in vendor/ or config/.
Where to Look First
ecphp/php-conventions ruleset (if available) for supported checks.PSR12 (Laravel follows PSR-12 by default).NoHardcodedValues (useful for config/database strings).LaravelSpecific (e.g., Route::get formatting, use ordering).Pre-Commit Hook
Integrate with Laravel’s pre-commit or use husky + php-conventions:
# .husky/pre-commit
./vendor/bin/php-conventions check src --no-cache
CI/CD Pipeline
Add to Laravel’s GitHub Actions (.github/workflows/php.yml):
- name: Run PHP Conventions
How can I help you explore Laravel packages today?