facile-it/facile-coding-standard
PHP coding standard based on PHP-CS-Fixer by Facile.it. Installs via Composer with an interactive setup that generates a .php-cs-fixer.dist.php, auto-detects files from composer autoload (psr-0/psr-4/classmap), and adds cs-check/cs-fix scripts.
Architecture fit: The updated package (v1.5.0) remains a Composer-friendly dev dependency but now enforces stricter PER-CS 3.0 rules with broader scope (e.g., trailing_comma_in_multiline now applies to all multi-line statements, not just arrays). While Laravel’s default PSR-12 alignment may conflict with some rules (e.g., multiline_promoted_properties, no_redundant_readonly_property), the package’s modularity allows selective adoption. The deprecation of PHP 7.4/8.0 and internal upgrades (PHPUnit 10+, Psalm 6, Rector) introduce dependency risks if the team’s CI/CD or testing stack isn’t modernized.
Integration feasibility: High for PHP 8.1+ projects, but breaking changes (e.g., stricter comma enforcement, risky rule updates) require manual review of existing codebases. The @PER-CS3x0:risky group replaces deprecated @PER-CS2.0:risky, necessitating rule-set migration. Rector integration (internal) could enable automated refactoring but adds complexity.
Technical risk:
no_useless_printf or phpdoc_no_duplicate_types may flag legitimate Laravel patterns (e.g., legacy printf-style logging).trailing_comma_in_multiline) could slow down static analysis in large codebases.Key questions:
risky rules (e.g., no_useless_printf) interact with Laravel’s legacy or third-party code (e.g., Blade templates)?Stack fit: Optimized for PHP 8.1+ Laravel projects with modern tooling (PHPUnit 10+, Psalm). Teams using older PHP versions or custom PSR-12 variants will face blockers. The package’s Composer integration remains seamless, but rule conflicts (e.g., multiline_promoted_properties vs. Laravel’s promotedProperties syntax) may require custom config overrides.
Migration path:
php-cs-fixer fix --dry-run to identify violations before enforcing rules.--rules=@PER-CS3x0 --exclude-rules=... to opt out of problematic rules (e.g., no_useless_printf).phpunit/phpunit and vimeo/psalm).rector/rector integration.Compatibility:
no_redundant_readonly_property may conflict with Laravel’s readonly properties in models/config.trailing_comma_in_multiline) could break Blade syntax if not excluded.phpdoc_no_duplicate_types), requiring vendor-specific exclusions.Sequencing:
--dry-run and address critical violations.risky violations).Maintenance:
Support:
multiline_promoted_properties).printf-style logging) will require documentation.Scaling:
Failure modes:
no_useless_printf may incorrectly flag Laravel’s legacy patterns.Ramp-up:
How can I help you explore Laravel packages today?