symplify/coding-standard
Ready-to-use PHP CS Fixer and PHP_CodeSniffer rules bundled as a coding standard, with Symplify tooling integration. Helps keep projects consistent, modern, and clean with configurable rule sets suited for CI and team workflows.
composer require --dev symplify/coding-standard
phpcs.xml or ecs.php) and extend the provided config:
<config name="Symplify\CodingStandard\CodeQuality\Symfony\PhpCsFixerConfig">
<rule set="symplify" />
</config>
Or, for ECS (recommended for newer setups):
use Symplify\CodingStandard\Symfony\EasyCodingStandardConfig;
return EasyCodingStandardConfig::configure()->withPaths(['src', 'tests']);
vendor/bin/ecs check src tests
# or
vendor/bin/php-cs-fixer fix --diff
ecs check or php-cs-fixer fix --dry-run to your pipeline.ecs check --no-progress to fail builds on style issues.lint-staged or Husky to auto-fix PHP files on stage/commit:
{
"lint-staged": {
"*.php": ["vendor/bin/ecs fix --no-progress", "git add"]
}
}
blank_line_after_opening_tag for cleaner controller files). Use symplify/coding-standard as the base and layer project-specific rules.--fix in CI using --dry-run first, then gradually relax or lock down rules per service or team.ecs (EasyCodingStandard) over php-cs-fixer CLI directly—ecs provides better Laravel integration, more actionable output, and simpler config.symplify/coding-standard’s composer.json for minimum PHP requirements.no_superfluous_elseif if you rely on explicit conditions for readability).ecs check --debug to inspect which rules applied—and why—helpful when debugging misfires.Symplify\EasyCodingStandard\Contract\ConfigInterface or using withConfiguredRules() in your ECS config.ecs behavior in-editor—config sharing helps here.--fix-dry-run + --severity flags to surface low-impact violations first, then ramp up enforcement incrementally.How can I help you explore Laravel packages today?