-
name
This method is optional. If not implemented, Relax will use the class name itself as the ruleset name.
-
rules
Define the PHP-CS-Fixer rules you want to use.
🧱 Resources:
<?php
use PhpCsFixerCustomFixers\Fixer;
use Realodix\Relax\RuleSet\AbstractRuleSet;
class MyRuleSet extends AbstractRuleSet
{
public function name(): string
{
// ...
}
public function rules(): array
{
return [
'@PSR2' => true,
'array_syntax' => [
'syntax' => 'short'
],
'blank_line_after_opening_tag' => true,
Fixer\NoImportFromGlobalNamespaceFixer::name() => true,
Fixer\NoLeadingSlashInGlobalNamespaceFixer::name() => true,
+ Fixer\PhpdocNoSuperfluousParamFixer::name() => true,
// ...
];
}
}