22
33declare (strict_types=1 );
44
5- namespace Ticketswap \PhpCsFixerConfig ;
5+ namespace Ticketswap \PhpCsFixerConfig \ RuleSet ;
66
77use ErickSkrauch \PhpCsFixer \Fixer \Whitespace \LineBreakAfterStatementsFixer ;
8- use PhpCsFixer \Config ;
9- use PhpCsFixer \Runner \Parallel \ParallelConfigFactory ;
108use PhpCsFixer \WhitespacesFixerConfig ;
119use Symplify \CodingStandard \Fixer \ArrayNotation \ArrayListItemNewlineFixer ;
1210use Symplify \CodingStandard \Fixer \ArrayNotation \ArrayOpenerAndCloserNewlineFixer ;
2725use Symplify \CodingStandard \TokenRunner \Traverser \ArrayBlockInfoFinder ;
2826use Symplify \CodingStandard \TokenRunner \Whitespace \IndentResolver ;
2927use Symplify \CodingStandard \TokenRunner \Wrapper \FixerWrapper \ArrayWrapperFactory ;
28+ use Ticketswap \PhpCsFixerConfig \Fixers ;
29+ use Ticketswap \PhpCsFixerConfig \NameWrapper ;
30+ use Ticketswap \PhpCsFixerConfig \Rules ;
31+ use Ticketswap \PhpCsFixerConfig \RuleSet ;
3032
31- final readonly class ConfigFactory
33+ final class TicketSwapRuleSet
3234{
33- /**
34- * @param array<string, array<string, mixed>|bool> $rules
35- */
36- public static function create (array $ rules = []) : Config
35+ public static function create () : RuleSet
3736 {
3837 $ whitespacesFixerConfig = new WhitespacesFixerConfig (' ' , "\n" );
3938 $ blockfinder = new BlockFinder ();
@@ -52,11 +51,8 @@ public static function create(array $rules = []) : Config
5251 $ paramNewliner = new ParamNewliner ($ blockfinder , $ tokensNewliner );
5352 $ methodNameResolver = new MethodNameResolver ();
5453
55- return new Config ()
56- ->setUnsupportedPhpVersionAllowed (true )
57- ->setCacheFile ('.php_cs.cache ' )
58- ->setRiskyAllowed (true )
59- ->registerCustomFixers ([
54+ return new RuleSet (
55+ new Fixers (
6056 new NameWrapper (
6157 new LineBreakAfterStatementsFixer (),
6258 'ErickSkrauch/line_break_after_statements ' ,
@@ -77,9 +73,9 @@ public static function create(array $rules = []) : Config
7773 new StandaloneLineConstructorParamFixer ($ paramNewliner , $ methodNameResolver ),
7874 'Symplify/standalone_line_constructor_param_fixer ' ,
7975 ),
80- ])
81- -> setParallelConfig (ParallelConfigFactory:: detect ())
82- -> setRules ([
76+ ),
77+ ' TicketSwap ' ,
78+ new Rules ([
8379 'ErickSkrauch/line_break_after_statements ' => true ,
8480 'Symplify/array_list_item_newline_fixer ' => true ,
8581 'Symplify/array_opener_and_closer_newline_fixer ' => true ,
@@ -284,8 +280,7 @@ public static function create(array $rules = []) : Config
284280 'identical ' => false ,
285281 'less_and_greater ' => null ,
286282 ],
287-
288- ...$ rules ,
289- ]);
283+ ]),
284+ );
290285 }
291286}
0 commit comments