33namespace MessagePack ;
44
55use PhpCsFixer \Config ;
6+ use PhpCsFixer \Fixer \ConfigurableFixerInterface ;
67use PhpCsFixer \Fixer \ConstantNotation \NativeConstantInvocationFixer ;
7- use PhpCsFixer \Fixer \FixerInterface ;
88use PhpCsFixer \Fixer \FunctionNotation \NativeFunctionInvocationFixer ;
9+ use PhpCsFixer \FixerConfiguration \FixerConfigurationResolver ;
10+ use PhpCsFixer \FixerDefinition \FixerDefinition ;
11+ use PhpCsFixer \FixerDefinition \FixerDefinitionInterface ;
912use PhpCsFixer \Tokenizer \Tokens ;
1013
11- final class FilterableFixer implements FixerInterface
14+ final class FilterableFixer implements ConfigurableFixerInterface
1215{
13- private $ fixer ;
14- private $ pathRegex ;
16+ private ConfigurableFixerInterface $ fixer ;
17+ private string $ pathRegex ;
1518
16- public function __construct (FixerInterface $ fixer , string $ pathRegex )
19+ public function __construct (ConfigurableFixerInterface $ fixer , string $ pathRegex )
1720 {
1821 $ this ->fixer = $ fixer ;
1922 $ this ->pathRegex = $ pathRegex ;
2023 }
2124
25+ public function configure (array $ configuration ): void
26+ {
27+ $ this ->fixer ->configure ($ configuration );
28+ }
29+
30+ public function getConfigurationDefinition (): FixerConfigurationResolver
31+ {
32+ return $ this ->fixer ->getConfigurationDefinition ();
33+ }
34+
2235 public function isCandidate (Tokens $ tokens ) : bool
2336 {
2437 return $ this ->fixer ->isCandidate ($ tokens );
@@ -52,7 +65,12 @@ public function supports(\SplFileInfo $file) : bool
5265
5366 return $ this ->fixer ->supports ($ file );
5467 }
55- };
68+
69+ public function getDefinition () : FixerDefinitionInterface
70+ {
71+ return $ this ->fixer ->getDefinition ();
72+ }
73+ }
5674
5775$ header = <<<EOF
5876This file is part of the rybakit/msgpack.php package.
@@ -63,7 +81,7 @@ public function supports(\SplFileInfo $file) : bool
6381file that was distributed with this source code.
6482EOF ;
6583
66- return Config:: create ( )
84+ return ( new Config () )
6785 ->setUsingCache (false )
6886 ->setRiskyAllowed (true )
6987 ->registerCustomFixers ([
@@ -75,13 +93,17 @@ public function supports(\SplFileInfo $file) : bool
7593 '@Symfony:risky ' => true ,
7694 'array_syntax ' => ['syntax ' => 'short ' ],
7795 'binary_operator_spaces ' => ['operators ' => ['= ' => null , '=> ' => null ]],
78- 'is_null ' => false , // https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/4015
96+ 'fully_qualified_strict_types ' => false ,
97+ 'integer_literal_case ' => false ,
98+ 'is_null ' => false ,
7999 'native_constant_invocation ' => false ,
80100 'native_function_invocation ' => false ,
81- 'FilterableFixer/native_constant_invocation ' => true ,
82- 'FilterableFixer/native_function_invocation ' => true ,
101+ 'FilterableFixer/native_constant_invocation ' => [ ' strict ' => false ] ,
102+ 'FilterableFixer/native_function_invocation ' => [ ' strict ' => false ] ,
83103 'no_useless_else ' => true ,
84104 'no_useless_return ' => true ,
105+ 'no_useless_concat_operator ' => false ,
106+ 'no_superfluous_phpdoc_tags ' => false ,
85107 'ordered_imports ' => [
86108 'sort_algorithm ' => 'alpha ' ,
87109 'imports_order ' => ['class ' , 'function ' , 'const ' ],
@@ -90,6 +112,7 @@ public function supports(\SplFileInfo $file) : bool
90112 'phpdoc_order ' => true ,
91113 'phpdoc_to_comment ' => false ,
92114 'return_type_declaration ' => ['space_before ' => 'one ' ],
115+ 'statement_indentation ' => false ,
93116 'strict_comparison ' => true ,
94117 'header_comment ' => [
95118 'comment_type ' => 'PHPDoc ' ,
0 commit comments