Relax is built on top of PHP-CS-Fixer and makes it easy to provide a standardized way to apply coding standards across multiple projects, ensuring consistency and adherence to best practices.
By using predefined rulesets, it simplifies the setup process and allows teams to quickly integrate PHP-CS-Fixer into their development workflow.
You can install this package by using composer:
composer require --dev realodix/relax./vendor/bin/php-cs-fixer fixuse Realodix\Relax\Config;
return Config::this()
->setRules([
'@Realodix/Laravel' => true,
]);or using the original PHP-CS-Fixer way
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$finder = (new Finder)->in(__DIR__);
return (new Config)
->registerCustomRuleSets([
new \Realodix\Relax\Rulesets\Laravel,
])
->setRules([
'@Realodix/Laravel' => true,
])
->setFinder($finder)
;-
@Realodix/Laravel-Realodix\Relax\Rulesets\LaravelRules that follow the official Laravel coding standards.
-
@Realodix/Relax-Realodix\Relax\Rulesets\RelaxLaravel based with a few tweaks.
By default, Relax will inspect all .php files in your project except those in the vendor directory.
| Method | Description |
|---|---|
Finder::base() |
The basic finder setup should be perfect for most PHP projects |
Finder::laravel() |
Inherits Finder::base() with some specific tweaks to Laravel |
💡 By default, if finder is not set Relax will use Finder::base().
For general help and support join our GitHub Discussions.
Please report bugs to the GitHub Issue Tracker.
This package is licensed under the MIT License.