Dixydo coding standard for PHP CodeSniffer.
This coding standard is based on PSR-12 with some additional 3rd party and custom sniffs to enforce better code formatting.
Install as a dev dependency using composer
composer require --dev dixydo/coding-standardCreate ruleset.xml in the root of your project
<?xml version="1.0"?>
<ruleset>
<arg name="basepath" value="."/>
<arg name="cache" value=".phpcs-cache"/>
<file>src/</file>
<config name="installed_paths" value="vendor/dixydo/coding-standard"/>
<rule ref="Dixydo"/>
</ruleset>Run the check and display report
vendor/bin/phpcs --standard=ruleset.xmlRun and automatically fix issues
vendor/bin/phpcbf --standard=ruleset.xml