realodix / relax
Shared php-cs-fixer rules & finders preset
Installs: 39 476
Dependents: 2
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- friendsofphp/php-cs-fixer: ^3.61
- kubawerlos/php-cs-fixer-custom-fixers: ^3.21
- symfony/console: ^5.4.41 || ^6.0 || ^7.0
Requires (Dev)
- phpstan/phpstan: ^1.11
- phpunit/phpunit: ^9.6
README
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.
Installation
You can install this package by using composer:
composer require --dev realodix/relax
Running Relax
./vendor/bin/php-cs-fixer fix
For more details, see PHP-CS-Fixer documentation.
Configuring Relax
You can easily create your own rule set by extending the Realodix\Relax\RuleSet\AbstractRuleSet
class and use it! See docs/example_ruleset.md for an example of how to create your own rule set.
<?php use Realodix\Relax\Config; use Vendor\Package\MyRuleSet; return Config::create(new MyRuleSet);
Sometimes for big dirty projects, you want to implement some local rules without implementing a ruleset, why not.
$localRules = [ // ... ]; Config::create() ->setRules($localRules);
For advanced configuration, see the docs/advanced_configuration.md
Presets
Preset defines a built-in set of rules that are ready to be used to fix code style issues in your code.
Config::create('laravel')
Finder Sets
By default, Relax will inspect all .php
files in your project except those in the vendor
directory.
💡 By default, if finder is not set Relax will use Finder::base()
.
Troubleshooting
For general help and support join our GitHub Discussions.
Please report bugs to the GitHub Issue Tracker.
License
This package is licensed under the MIT License.