laravel-style-rules maintained by bitvalencia
Description
Laravel style rules for PHP-CS-Fixer
Author
Last update
2020/10/01 00:11
(dev-main)
License
Downloads
197
Tags
Laravel style rules for PHP-CS-Fixer
These are the rules applied across all our projects.
Installation
You can install using composer from Packagist.
composer require bitvalencia/laravel-style-rules --dev
Usage
In your .php_cs config file
<?php
// specify the paths to fix
$finder = PhpCsFixer\Finder::create()
->notPath('bootstrap/*')
->notPath('storage/*')
->notPath('vendor')
->in([
__DIR__ . '/app',
__DIR__ . '/tests',
__DIR__ . '/database',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
// then call and return the following style function
return BitValencia\style_rules($finder);
Running
Running the command
./vendor/bin/php-cs-fixer fix
Running in CI
./vendor/bin/php-cs-fixer fix --dry-run
Resources
- Sharing PHP-CS-Fixer rules across projects and teams. Laravel News Article
- Laravel Shift Recommended Coding Ruleset. Gist - Shift
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.