broadway/coding-standard
Opinionated PHP_CodeSniffer rules used at Broadway to enforce consistent, modern PHP style across projects. Easy to install and run in CI to catch formatting and code quality issues early, helping teams keep codebases clean and uniform.
composer require --dev broadway/coding-standard).pre-commit) or CI pipelines (GitHub Actions, GitLab CI).Event suffixes), it may clash with Laravel’s conventions.DomainEvent vs. Event).spatie/laravel-activitylog)?php-cs-fixer (PSR-12/PSR-2) for generic Laravel projects.broadway/broadway itself if event sourcing is a core requirement.composer require --dev broadway/coding-standard
php-cs-fixer.dist.php (if applicable):
return (new PhpCsFixer\Config())
->setRules([
'@Broadway' => true, // Hypothetical rule set
]);
- name: Run Coding Standard
run: vendor/bin/php-cs-fixer fix --rules=@Broadway --dry-run
composer.json to avoid surprises.Route:: prefixes).| Failure Type | Impact | Mitigation |
|---|---|---|
| Strict Rules | Blocks PRs due to false positives | Start with --dry-run, customize rules |
| Outdated Standard | Conflicts with newer Broadway | Pin version, monitor updates |
| Tooling Breakage | PHP-CS-Fixer/Pest conflicts | Test in staging before enforcement |
| Low Adoption | Team ignores the standard | Enforce in CI, pair with code reviews |
How can I help you explore Laravel packages today?