ecs.php, making it adaptable to Laravel’s PSR-12 and framework-specific conventions.vendor/bin/ecs), making integration straightforward.UnusedVariableSniff for Blade files).php-cs-fixer).whatwedo-symfony.php, whatwedo-common.php)?
rector/rector)?require).husky or pre-commit.app/ directory).whatwedo-common.php, then customize ecs.php for Laravel-specific rules.$ecsConfig->skip([
// Skip Blade-specific unused vars
__DIR__.'/resources/views/**',
]);
- name: Run PHP Coding Standard
run: vendor/bin/ecs check src --config=ecs.php
--fix flag for non-breaking changes.*.blade.php) may need exclusions.DB::table() style).node_modules for Laravel Mix) should be excluded.database/, routes/).ecs.php."Error: Line exceeds 120 chars. Fix with
vendor/bin/ecs fix --dry-run."
--parallel flag or split checks (e.g., app/ vs. tests/).| Failure | Mitigation | Recovery |
|---|---|---|
| CI pipeline flakes | Cache ECS results | Retry with --parallel |
| Overly strict rules | Customize ecs.php |
Gradually relax rules |
| Developer resistance | Pair programming on fixes | Highlight long-term benefits |
| Package abandonment | Fork or migrate to php-cs-fixer |
Document migration path |
check, fix, skip).How can I help you explore Laravel packages today?