Skip to content

Commit

Permalink
Added option for custom fixers
Browse files Browse the repository at this point in the history
  • Loading branch information
nizacegodk committed Sep 9, 2021
1 parent 86e148c commit af2bad1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CegoFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

namespace Cego;

use Traversable;
use PhpCsFixer\Finder;
use PhpCsFixer\Config;
use PhpCsFixer\Fixer\FixerInterface;

class CegoFixer
{
Expand All @@ -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));
}
}

0 comments on commit af2bad1

Please sign in to comment.