Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Symfony Conventions

Symfony Conventions Laravel Package

phpro/symfony-conventions

A PHP_CodeSniffer ruleset that enforces Symfony coding conventions across your project, helping teams keep controllers, services and configuration consistent. Add it to local tooling or CI for automated, framework-aligned code quality checks.

View on GitHub
Deep Wiki
Context7

GrumPHP conventions for Symfony projects at PHPro

Frequently asked questions about Symfony Conventions
What is phpro/symfony-conventions used for?
It is a reusable PHP-CS-Fixer ruleset that applies Symfony-oriented coding conventions to PHP codebases. Instead of copying rule arrays between projects, you install it once and share the same style configuration across applications, bundles and CI pipelines. It is aimed at teams that want framework-aligned formatting without maintaining their own ruleset from scratch.
How do I install phpro/symfony-conventions?
Install it with Composer, typically as a dev dependency since it only affects code style tooling, for example composer require --dev phpro/symfony-conventions. Then reference the supplied ruleset from your PHP-CS-Fixer configuration. Because it is a Composer package, it fits naturally into existing local and CI workflows.
Is it a PHP-CS-Fixer ruleset or a PHP_CodeSniffer standard?
The package is documented as a PHP-CS-Fixer ruleset for Symfony conventions, so it plugs into PHP-CS-Fixer rather than PHP_CodeSniffer. Some summaries describe it loosely as a coding standard, which can be confusing if you are looking for a phpcs.xml setup. If your project uses PHP_CodeSniffer, you would need a different standard or a bridge.
Can I use phpro/symfony-conventions in a Laravel project?
Yes, in practice a PHP-CS-Fixer ruleset is not tied to a framework at runtime, so you can apply it to Laravel code if you want Symfony-style conventions. Keep in mind the rules are Symfony-oriented, so they may not match every Laravel or PSR-12 preference. Many teams start from the ruleset and add their own overrides.
How do I configure phpro/symfony-conventions in .php-cs-fixer.php?
You include the package's ruleset in your PHP-CS-Fixer config and then add project-specific rules on top. The exact include path depends on the installed package version, so check the README of the version you require. This keeps shared conventions centralised while still allowing per-project tweaks.
Can I override or extend the bundled rules?
The package is described as easy to extend or override per project, which is normal for PHP-CS-Fixer rulesets. You can start from the Symfony-focused defaults and adjust individual rules or add your own finder paths. This lets teams adopt the shared baseline gradually instead of rewriting their entire codebase at once.
Which PHP and PHP-CS-Fixer versions does phpro/symfony-conventions support?
Support depends on the package release you install, so check the require constraints in its composer.json and the release notes. Before a major PHP-CS-Fixer upgrade, run the tool on a branch and review the diff. This is especially important because PHP-CS-Fixer occasionally renames or removes rules.
How do I run phpro/symfony-conventions in CI?
Add PHP-CS-Fixer to your CI job, install dependencies with Composer, and run PHP-CS-Fixer in dry-run mode so the build fails on style violations. A typical command is vendor/bin/php-cs-fixer fix --dry-run --diff. Caching the Composer and PHP-CS-Fixer caches keeps pipeline runs fast.
Does it work for Symfony bundles and applications?
Yes, the ruleset is intended for both applications and bundles, so the same conventions can be shared across a monorepo or multiple packages. That consistency is useful when controllers, services and configuration files move between projects. You can still layer bundle-specific overrides if a package has unusual requirements.
What are alternatives to phpro/symfony-conventions?
Common alternatives are the built-in @Symfony ruleset shipped with PHP-CS-Fixer, custom in-house rulesets, or PHP_CodeSniffer-based standards such as PSR-12 and Symfony coding standard sniffs. The right choice depends on whether your team prefers PHP-CS-Fixer or PHP_CodeSniffer. phpro/symfony-conventions mainly saves you from duplicating a Symfony-focused ruleset across projects.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource