I use this package to set up a consistent PHPCS configuration across my Laravel projects. The ruleset is based on @nandosalles' ruleset.
If you wish to use this configuration in your project, install it using composer:
composer require --dev emielmolenaar/phpcs-laravel
Afterwards, you may run php vendor/bin/phpcs -i
and see phpcs-laravel
listed as an installed ruleset.
You may now use the ruleset like so:
php vendor/bin/phpcs --standard=phpcs-laravel my_file.php
Note, If you're installing globally with Composer you can simply do phpcs -i
.
Contributions welcome.