22
22
use PHPCR \Shell \PhpcrShell ;
23
23
use Symfony \Component \Console \Application ;
24
24
use Symfony \Component \Console \Command \Command ;
25
- use Symfony \Component \Console \Formatter \OutputFormatter ;
25
+ use Symfony \Component \Console \Formatter \OutputFormatterInterface ;
26
26
use Symfony \Component \Console \Formatter \OutputFormatterStyle ;
27
27
use Symfony \Component \Console \Input \ArrayInput ;
28
28
use Symfony \Component \Console \Input \InputInterface ;
@@ -201,7 +201,7 @@ protected function registerShellCommands()
201
201
/**
202
202
* Configure the output formatter.
203
203
*/
204
- private function configureFormatter (OutputFormatter $ formatter )
204
+ private function configureFormatter (OutputFormatterInterface $ formatter )
205
205
{
206
206
$ style = new OutputFormatterStyle ('yellow ' , null , ['bold ' ]);
207
207
$ formatter ->setStyle ('pathbold ' , $ style );
@@ -234,10 +234,7 @@ private function configureFormatter(OutputFormatter $formatter)
234
234
$ formatter ->setStyle ('exception ' , $ style );
235
235
}
236
236
237
- /**
238
- * {@inheritdoc}
239
- */
240
- public function doRun (InputInterface $ input , OutputInterface $ output )
237
+ public function doRun (InputInterface $ input , OutputInterface $ output ): int
241
238
{
242
239
$ this ->init ();
243
240
@@ -279,19 +276,19 @@ protected function getDefaultCommand()
279
276
*
280
277
* {@inheritdoc}
281
278
*/
282
- public function add (Command $ command )
279
+ public function add (Command $ command ): ? Command
283
280
{
284
281
if ($ command instanceof ContainerAwareInterface) {
285
282
$ command ->setContainer ($ this ->container );
286
283
}
287
284
288
- if ($ command instanceof BasePhpcrCommand) {
289
- if ($ this ->showUnsupported || $ command ->isSupported ()) {
290
- parent ::add ($ command );
291
- }
292
- } else {
293
- parent ::add ($ command );
285
+ if ($ command instanceof BasePhpcrCommand
286
+ && ($ this ->showUnsupported || $ command ->isSupported ())
287
+ ) {
288
+ return parent ::add ($ command );
294
289
}
290
+
291
+ return parent ::add ($ command );
295
292
}
296
293
297
294
public function dispatchProfileInitEvent (InputInterface $ sessionInput , OutputInterface $ output )
@@ -307,7 +304,7 @@ public function dispatchProfileInitEvent(InputInterface $sessionInput, OutputInt
307
304
*
308
305
* {@inheritdoc}
309
306
*/
310
- public function all ($ namespace = null )
307
+ public function all ($ namespace = null ): array
311
308
{
312
309
$ this ->init ();
313
310
0 commit comments