2020
2121return new class implements DiagnosticsPluginInterface, ExecPluginInterface
2222{
23+ /** @psalm-suppress MissingClassConstType */
2324 private const RECTOR_FILE_TEMPLATE = <<<'PHP'
2425<?php
2526
5455})(%s, %s, %s, %s);
5556PHP;
5657
58+ #[Override]
5759 public function getName (): string
5860 {
5961 return 'rector ' ;
6062 }
6163
64+ #[Override]
6265 public function describeConfiguration (PluginConfigurationBuilderInterface $ configOptionsBuilder ): void
6366 {
6467 $ configOptionsBuilder
@@ -75,6 +78,7 @@ public function describeConfiguration(PluginConfigurationBuilderInterface $confi
7578 ->isRequired ();
7679 }
7780
81+ #[Override]
7882 public function createDiagnosticTasks (
7983 PluginConfigurationInterface $ config ,
8084 EnvironmentInterface $ environment ,
@@ -91,6 +95,7 @@ public function createDiagnosticTasks(
9195 yield $ factory ->build ();
9296 }
9397
98+ #[Override]
9499 public function describeExecTask (
95100 ExecTaskDefinitionBuilderInterface $ definitionBuilder ,
96101 EnvironmentInterface $ environment ,
@@ -165,11 +170,11 @@ private function parseOption(
165170
166171 foreach (array_filter ([$ matches [3 ], $ matches [5 ]]) as $ name ) {
167172 $ option = $ builder ->describeOption ($ name , $ matches [8 ]);
168- if ($ matches [7 ]) {
173+ if ($ matches [7 ] !== '' && $ matches [ 7 ] !== ' 0 ' ) {
169174 $ option ->withOptionalValue ($ matches [7 ]);
170175 }
171176
172- if ($ matches [2 ]) {
177+ if ($ matches [2 ] !== '' && $ matches [ 2 ] !== ' 0 ' ) {
173178 $ option ->withShortcut ($ matches [2 ]);
174179 }
175180 }
@@ -221,6 +226,7 @@ private function parseCommand(
221226 }
222227
223228 /** {@inheritDoc} */
229+ #[Override]
224230 public function createExecTask (
225231 string |null $ application ,
226232 array $ arguments ,
@@ -282,6 +288,7 @@ public function __construct(private readonly bool $dryRun)
282288 {
283289 }
284290
291+ #[Override]
285292 public function createFor (TaskReportInterface $ report ): OutputTransformerInterface
286293 {
287294 /**
@@ -317,11 +324,13 @@ public function __construct(
317324 $ this ->data = BufferedLineReader::create ();
318325 }
319326
327+ #[Override]
320328 public function write (string $ data , int $ channel ): void
321329 {
322330 $ this ->data ->push ($ data );
323331 }
324332
333+ #[Override]
325334 public function finish (int $ exitCode ): void
326335 {
327336 $ this ->process ();
@@ -400,6 +409,7 @@ private function createOutputToStringHandler(): Stringable|OutputInterface
400409 return new class implements OutputInterface {
401410 private string $ output = '' ;
402411
412+ #[Override]
403413 public function write (
404414 string $ message ,
405415 int $ verbosity = self ::VERBOSITY_NORMAL ,
@@ -410,6 +420,7 @@ public function write(
410420 }
411421 }
412422
423+ #[Override]
413424 public function writeln (
414425 string $ message ,
415426 int $ verbosity = self ::VERBOSITY_NORMAL ,
0 commit comments