You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Realodix Relax** is built on top of [`PHP-CS-Fixer`][php-cs-fixer] and makes it simple to to sharing identical PHP CS Fixer rules across all of your projects without copy-and-pasting configuration files.
7
+
**Relax** is built on top of [`PHP-CS-Fixer`](https://github.com/PHP-CS-Fixer/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.
8
8
9
+
By using predefined rulesets, it simplifies the setup process and allows teams to quickly integrate PHP-CS-Fixer into their development workflow.
9
10
10
11
## Installation
11
12
@@ -27,24 +28,35 @@ For more details, see PHP-CS-Fixer [documentation](https://github.com/PHP-CS-Fix
27
28
28
29
## Configuring Relax
29
30
30
-
In your PHP CS Fixer configuration file, use the following contents:
31
+
You can easily create your own rule set by extending the [`Realodix\Relax\RuleSet\AbstractRuleSet`](src/RuleSet/AbstractRuleSet.php) class and use it! See [docs/example_ruleset.md](docs/example_ruleset.md) for an example of how to create your own rule set.
31
32
32
33
```php
33
34
<?php
34
35
35
36
use Realodix\Relax\Config;
37
+
use Vendor\Package\MyRuleSet;
38
+
39
+
return Config::create(new MyRuleSet)
40
+
->setFinder(/* ... */);
41
+
```
42
+
43
+
Sometimes for big dirty projects, you want to implement some local rules without implementing a ruleset, why not.
36
44
45
+
```php
37
46
$localRules = [
38
47
// ...
39
48
];
40
49
41
-
return Config::create('laravel')
42
-
->setRules($localRules);
50
+
Config::create()
51
+
->setRules($localRules)
52
+
->setFinder(/* ... */);
43
53
```
44
54
45
-
#### Rulesets
55
+
For advanced configuration, see the [docs/advanced_configuration.md](docs/advanced_configuration.md)
56
+
57
+
### Presets
46
58
47
-
A ruleset is a named list of rules that can be used to fix code style issues in your code. To use ruleset in your PHP code, you need to use the `Realodix\Relax\RuleSet\Sets\` namespace.
59
+
Preset defines a built-in set of rules that are ready to be used to fix code style issues in your code.
48
60
49
61
| Ruleset | Description |
50
62
| ------------------------- |-------------|
@@ -56,68 +68,8 @@ A ruleset is a named list of rules that can be used to fix code style issues in
0 commit comments