escapestudios/symfony2-coding-standard
PHP_CodeSniffer ruleset applying Symfony2 coding standards. Helps enforce consistent formatting, naming, and best practices in Symfony/PHP projects. Easy to install via Composer and integrate into CI to catch style issues early.
composer require --dev escapestudios/symfony2-coding-standard in your Symfony project.phpcs.xml (or create one in project root):
<?xml version="1.0"?>
<ruleset name="Symfony">
<rule ref="vendor/escapestudios/symfony2-coding-standard/Symfony"/>
<file>src/</file>
<file>tests/</file>
</ruleset>
vendor/bin/phpcs to scan code for violations.vendor/bin/phpcbf to automatically fix PSR and Symfony-specific sniffs (e.g., method visibility, type declarations, PHPDoc ordering).phpcs in GitHub Actions/GitLab CI:
- run: vendor/bin/phpcs -n
husky + lint-staged to run phpcbf only on staged files for incremental compliance.phpcs.xml ruleset inheritance.phpcs --standard=PSR12 then layer in Symfony standard per-file to avoid breaking legacy code.composer global require "squizlabs/php_codesniffer=*" if needed.->), which may conflict with developer style. Override via <exclude name="Symfony.Functions.MultiLineFunctionBrace"/> in phpcs.xml.Symfony.Functions.MultiLineFunctionBrace may conflict with native type hints—ensure phpstan/phpstan is used for deeper static analysis.phpcs on .twig files—use symfony/twig-pack’s built-in linting instead.phpcs -v for verbose output or phpcs -i to list installed standards.<rule ref="Symfony.NamingConventions.ValidVariableName.PrivateVarName">
<type>error</type>
</rule>
<rule ref="Symfony.NamingConventions.ValidVariableName.PrivateVarName">
<severity>0</severity>
</rule>
How can I help you explore Laravel packages today?