enabel/coding-standard-bundle
A Symfony bundle providing ready-made coding standards and tooling: PHP-CS-Fixer, PHPStan, Rector, linters for Twig, YAML, Doctrine and Composer, plus a Makefile and Docker setup for MySQL, Redis and Mailcatcher.
composer require --dev enabel/coding-standard-bundle
config/bundles.php (if Flex didn't do it automatically):
Enabel\CodingStandardBundle\EnabelCodingStandardBundle::class => ['dev' => true, 'test' => true],
docs/index.md in the repository. It is the canonical reference for the Makefile targets, Docker services, and default tool configuration. Skim README.md → docs/index.md → CHANGELOG.md in that order.Makefile with targets wiring all of the above togethermake cs-check
make phpstan
make lint
This is the fastest way to see what the bundle enforces and to decide which rules you want to keep, override, or baseline.make up
Make targets as the developer contract. The bundle’s value is that everyone runs the same commands. Treat the bundle’s targets (cs, cs-check, phpstan, rector, lint, test, up, down) as the project’s canonical entry points, and wire them into your own Makefile or a thin wrapper so local usage and CI invoke identical commands.
CI integration. In GitHub Actions (or GitLab CI), install with --dev, then call the same make targets. Because the bundle pins known-good configurations for PHPStan/Rector/CS-Fixer, you get reproducible results across local and CI without maintaining parallel phpstan.neon files.
Layered configuration. Keep the bundle’s defaults as the base and publish/override per-project config only where you genuinely diverge:
phpstan.neon — add project-specific includes, custom rule extensions, and a baseline.neon for pre-existing violations so you can adopt the standard incrementally..php-cs-fixer.dist.php — extend the bundle’s ruleset rather than replacing it; add project-specific rules on top.rector.php — start with the bundle’s rule sets and layer in per-upgrade paths when you take a Symfony/LTS bump.Rector for upgrades, not routine commits. Use Rector dry-runs (--dry-run) in CI to preview changes, and apply real refactors in a dedicated branch during framework or PHP-version upgrades. This keeps Rector noise out of feature PRs.
Docker for dev-environment parity. Use the shipped Compose services (MySQL, Redis, Mailcatcher) so tests behave the same on every machine. Point DATABASE_URL, REDIS_URL, and MAILER_DSN at these services in .env.test / .env.dev.test and keep them out of production config.
Lint targets in pre-commit hooks. Add a small Husky/pre-commit hook that runs make cs-check and make lint (the fast linters) before commit, and leave PHPStan/Rector for CI or a pre-push hook — they’re heavier.
Container and service linters in CI only. The Symfony container/service and Doctrine linters need a bootable kernel, so run them after composer install on a clean checkout — don’t rely on them locally with a dirty cache.
phpstan.neon, .php-cs-fixer.dist.php, or rector.php, the bundle’s defaults may be silently ignored (or vice versa) depending on load order. Explicitly require/include the bundle’s config from your project files so the inheritance is visible in a diff.make is installed. Windows devs without WSL/Git Bash will hit this. Either document the WSL prerequisite or expose equivalent Composer scripts (composer lint, composer stan) as fallbacks.make up.bin/console cache:clear (or make cc) before re-running.-v / -vv; if a target doesn’t surface enough detail, run the underlying binary directly (e.g. vendor/bin/phpstan analyse -v) rather than through the make wrapper.require the bundle in production. It’s a dev tool — keep it in require-dev and guard the bundle registration with ['dev' => true, 'test' => true].How can I help you explore Laravel packages today?