Skip to content

Rule reference

Any rule can be registered on its own, without pulling in its set:

php
use SanderMuller\FluentValidationRector\Rector\ValidationArrayToFluentRuleRector;
use SanderMuller\FluentValidationRector\Rector\ValidationStringToFluentRuleRector;

return RectorConfig::configure()
    ->withRules([
        ValidationStringToFluentRuleRector::class,
        ValidationArrayToFluentRuleRector::class,
    ]);
RuleSetDoes
InlineResolvableParentRulesRectorCONVERT, in ALLinlines a ...parent::rules() spread when the parent is a plain return
ValidationStringToFluentRuleRectorCONVERT, in ALLpipe-delimited strings → FluentRule chains
ValidationArrayToFluentRuleRectorCONVERT, in ALLrule arrays, Rule:: and Password:: objects → FluentRule chains
ConvertLivewireRuleAttributeRectorCONVERT, in ALLLivewire #[Rule] / #[Validate] → a generated rules()
GroupWildcardRulesToEachRectorGROUP, in ALLflat wildcard and dotted keys → nested each() / children()
AddHasFluentRulesTraitRectorTRAITS, in ALLadds use HasFluentRules; to FormRequests using FluentRule or declaring schema()
AddHasFluentValidationTraitRectorTRAITS, in ALLadds the Livewire trait, plain or Filament variant
PromoteFieldFactoryRectorSIMPLIFY, not in ALLfield()->rule('max:61')string()->max(61)
SimplifyFluentRuleRectorSIMPLIFY, not in ALLfactory shortcuts, between(), redundant-type cleanup
SimplifyRuleWrappersRectorSIMPLIFY, not in ALL->rule('in:a,b') and friends → native typed methods
InlineMessageParamRectorSIMPLIFY, not in ALL->message() / ->messageFor() → inline message: param
UpdateRulesReturnTypeDocblockRectorPOLISH, not in ALLnarrows @return on pure-fluent rules()
ConvertToFluentSchemaRectorSCHEMA, not in ALLrules() of FluentRule:: chains → a schema(FluentSchema $rules) builder

The frozen public surface (symbols, wire keys, behaviour) is in PUBLIC_API.md.