@@ -82,9 +82,7 @@ public function getConfigurationDefinition(): FixerConfigurationResolverInterfac
8282 throw new InvalidFixerConfigurationException ($ fixerName , \sprintf ('The directory "%s" does not exists. ' , $ value ));
8383 }
8484
85- $ value = realpath ($ value ) . \DIRECTORY_SEPARATOR ;
86-
87- return $ value ;
85+ return \realpath ($ value ) . \DIRECTORY_SEPARATOR ;
8886 })
8987 ->getOption (),
9088 ]);
@@ -150,30 +148,35 @@ public function fix(\SplFileInfo $file, Tokens $tokens): void
150148
151149 private function ensureIsDocBlockWithNoNameArgumentsTag (Tokens $ tokens , int $ index ): void
152150 {
153- /** @var \Closure(Tokens, int, WhitespacesFixerConfig): void $closure */
154- static $ closure ;
155-
156- if ( $ closure === null ) {
157- $ function = function ( Tokens $ tokens , int $ index , WhitespacesFixerConfig $ whitespacesConfig ): void {
158- $ object = new class () extends AbstractPhpUnitFixer implements WhitespacesAwareFixerInterface {
159- public function ensureIsDocBlockWithNoNameArgumentsTag ( Tokens $ tokens , int $ index , WhitespacesFixerConfig $ whitespacesConfig ): void
160- {
161- $ this -> setWhitespacesConfig ( $ whitespacesConfig );
162- $ this -> ensureIsDocBlockWithAnnotation ( $ tokens , $ index , ' no-named-arguments ' , [ ' no-named-arguments ' ], [] );
163- }
151+ static $ abstractPhpUnitFixer ;
152+
153+ if ( $ abstractPhpUnitFixer === null ) {
154+ $ abstractPhpUnitFixer = new class () extends AbstractPhpUnitFixer implements WhitespacesAwareFixerInterface {
155+ /**
156+ * @codeCoverageIgnoreStart
157+ */
158+ protected function applyPhpUnitClassFix ( Tokens $ tokens , int $ startIndex , int $ endIndex ): void
159+ {
160+ throw new \ BadMethodCallException ( ' Not implemented ' );
161+ }
164162
165- protected function applyPhpUnitClassFix (Tokens $ tokens , int $ startIndex , int $ endIndex ): void {}
163+ public function getDefinition (): FixerDefinitionInterface
164+ {
165+ throw new \BadMethodCallException ('Not implemented ' );
166+ }
166167
167- public function getDefinition (): FixerDefinitionInterface
168- {
169- throw new \BadMethodCallException ('Not implemented ' );
170- }
171- };
172- $ object ->ensureIsDocBlockWithNoNameArgumentsTag ($ tokens , $ index , $ whitespacesConfig );
168+ /**
169+ * @codeCoverageIgnoreEnd
170+ */
171+ public function ensureIsDocBlockWithNoNameArgumentsTag (Tokens $ tokens , int $ index , WhitespacesFixerConfig $ whitespacesConfig ): void
172+ {
173+ $ this ->setWhitespacesConfig ($ whitespacesConfig );
174+ $ this ->ensureIsDocBlockWithAnnotation ($ tokens , $ index , 'no-named-arguments ' , ['no-named-arguments ' ], []);
175+ }
173176 };
174- $ closure = \Closure::bind ($ function , null , AbstractPhpUnitFixer::class);
175177 }
176178
177- $ closure ($ tokens , $ index , $ this ->whitespacesConfig );
179+ // @phpstan-ignore method.nonObject
180+ $ abstractPhpUnitFixer ->ensureIsDocBlockWithNoNameArgumentsTag ($ tokens , $ index , $ this ->whitespacesConfig );
178181 }
179182}
0 commit comments