diff --git a/src/CegoFixer.php b/src/CegoFixer.php index 09e5e7e..0e13cf8 100644 --- a/src/CegoFixer.php +++ b/src/CegoFixer.php @@ -2,8 +2,10 @@ namespace Cego; +use Traversable; use PhpCsFixer\Finder; use PhpCsFixer\Config; +use PhpCsFixer\Fixer\FixerInterface; class CegoFixer { @@ -13,16 +15,18 @@ class CegoFixer * @param Finder $finder * @param array $customRules * @param false $isRiskyAllowed + * @param FixerInterface[]|iterable|Traversable $customFixers * * @return Config */ - public static function applyRules(Finder $finder, array $customRules = [], bool $isRiskyAllowed = false): Config + public static function applyRules(Finder $finder, array $customRules = [], bool $isRiskyAllowed = false, iterable $customFixers = []): Config { return (new Config()) ->setFinder($finder) ->setRiskyAllowed($isRiskyAllowed) ->setHideProgress(false) ->setUsingCache(true) + ->registerCustomFixers($customFixers) ->setRules(array_merge(CegoRuleSet::get(), $customRules)); } } \ No newline at end of file