adeoweb / adeo-coding-style-php
AdeoWeb standards
1.1.6
2026-08-26 12:36 UTC
Requires
- slevomat/coding-standard: ^8.15
Suggests
- magento/magento-coding-standard: Required for usage with Magento 2.
README
A set of AdeoWeb rules for PHP_CodeSniffer, built on PSR-12 and the Slevomat Coding Standard. An optional ruleset extends the base rules for Magento 2 projects.
Installation
Require the package as a dev dependency:
composer require --dev adeoweb/adeo-coding-style-php
Then reference the ruleset from your project's phpcs.xml:
<?xml version="1.0"?> <ruleset> <rule ref="./vendor/adeoweb/adeo-coding-style-php/src/AdeoWebCodingStandard/ruleset.xml"/> <arg name="extensions" value="php,phtml"/> <file>./src</file> </ruleset>
Magento projects
For Magento 2 projects, also require magento/magento-coding-standard and use the Magento-specific ruleset, which extends the base rules above with Magento-specific ones:
<?xml version="1.0"?> <ruleset> <rule ref="./vendor/adeoweb/adeo-coding-style-php/src/AdeoWebCodingStandard/Magento/ruleset.xml"/> <arg name="extensions" value="php,phtml"/> <file>./app/code</file> </ruleset>
Usage
Checking code style
./vendor/bin/phpcs
Fixing issues automatically
phpcbf automatically fixes violations flagged as fixable, e.g. PHPCBF CAN FIX THE [0-9]+ MARKED SNIFF VIOLATIONS AUTOMATICALLY:
./vendor/bin/phpcbf app/code/MyAwesomeExtension
Versioning
Releases are cut based on how a rule's message changes:
- Patch — a
WARNING-level message changed: added, removed, or its parameters changed - Minor — an
ERROR-level message changed
See CHANGELOG.md for release history.