@@ -110,10 +110,7 @@ public function setDispatcher(EventDispatcherInterface $dispatcher): void
110
110
$ this ->dispatcher = $ dispatcher ;
111
111
}
112
112
113
- /**
114
- * @return void
115
- */
116
- public function setCommandLoader (CommandLoaderInterface $ commandLoader )
113
+ public function setCommandLoader (CommandLoaderInterface $ commandLoader ): void
117
114
{
118
115
$ this ->commandLoader = $ commandLoader ;
119
116
}
@@ -127,10 +124,7 @@ public function getSignalRegistry(): SignalRegistry
127
124
return $ this ->signalRegistry ;
128
125
}
129
126
130
- /**
131
- * @return void
132
- */
133
- public function setSignalsToDispatchEvent (int ...$ signalsToDispatchEvent )
127
+ public function setSignalsToDispatchEvent (int ...$ signalsToDispatchEvent ): void
134
128
{
135
129
$ this ->signalsToDispatchEvent = $ signalsToDispatchEvent ;
136
130
}
@@ -220,7 +214,7 @@ public function run(InputInterface $input = null, OutputInterface $output = null
220
214
*
221
215
* @return int 0 if everything went fine, or an error code
222
216
*/
223
- public function doRun (InputInterface $ input , OutputInterface $ output )
217
+ public function doRun (InputInterface $ input , OutputInterface $ output ): int
224
218
{
225
219
if (true === $ input ->hasParameterOption (['--version ' , '-V ' ], true )) {
226
220
$ output ->writeln ($ this ->getLongVersion ());
@@ -323,17 +317,11 @@ public function doRun(InputInterface $input, OutputInterface $output)
323
317
return $ exitCode ;
324
318
}
325
319
326
- /**
327
- * @return void
328
- */
329
- public function reset ()
320
+ public function reset (): void
330
321
{
331
322
}
332
323
333
- /**
334
- * @return void
335
- */
336
- public function setHelperSet (HelperSet $ helperSet )
324
+ public function setHelperSet (HelperSet $ helperSet ): void
337
325
{
338
326
$ this ->helperSet = $ helperSet ;
339
327
}
@@ -346,10 +334,7 @@ public function getHelperSet(): HelperSet
346
334
return $ this ->helperSet ??= $ this ->getDefaultHelperSet ();
347
335
}
348
336
349
- /**
350
- * @return void
351
- */
352
- public function setDefinition (InputDefinition $ definition )
337
+ public function setDefinition (InputDefinition $ definition ): void
353
338
{
354
339
$ this ->definition = $ definition ;
355
340
}
@@ -419,10 +404,8 @@ public function areExceptionsCaught(): bool
419
404
420
405
/**
421
406
* Sets whether to catch exceptions or not during commands execution.
422
- *
423
- * @return void
424
407
*/
425
- public function setCatchExceptions (bool $ boolean )
408
+ public function setCatchExceptions (bool $ boolean ): void
426
409
{
427
410
$ this ->catchExceptions = $ boolean ;
428
411
}
@@ -437,10 +420,8 @@ public function isAutoExitEnabled(): bool
437
420
438
421
/**
439
422
* Sets whether to automatically exit after a command execution or not.
440
- *
441
- * @return void
442
423
*/
443
- public function setAutoExit (bool $ boolean )
424
+ public function setAutoExit (bool $ boolean ): void
444
425
{
445
426
$ this ->autoExit = $ boolean ;
446
427
}
@@ -455,10 +436,8 @@ public function getName(): string
455
436
456
437
/**
457
438
* Sets the application name.
458
- *
459
- * @return void
460
439
*/
461
- public function setName (string $ name )
440
+ public function setName (string $ name ): void
462
441
{
463
442
$ this ->name = $ name ;
464
443
}
@@ -473,20 +452,16 @@ public function getVersion(): string
473
452
474
453
/**
475
454
* Sets the application version.
476
- *
477
- * @return void
478
455
*/
479
- public function setVersion (string $ version )
456
+ public function setVersion (string $ version ): void
480
457
{
481
458
$ this ->version = $ version ;
482
459
}
483
460
484
461
/**
485
462
* Returns the long version of the application.
486
- *
487
- * @return string
488
463
*/
489
- public function getLongVersion ()
464
+ public function getLongVersion (): string
490
465
{
491
466
if ('UNKNOWN ' !== $ this ->getName ()) {
492
467
if ('UNKNOWN ' !== $ this ->getVersion ()) {
@@ -513,10 +488,8 @@ public function register(string $name): Command
513
488
* If a Command is not enabled it will not be added.
514
489
*
515
490
* @param Command[] $commands An array of commands
516
- *
517
- * @return void
518
491
*/
519
- public function addCommands (array $ commands )
492
+ public function addCommands (array $ commands ): void
520
493
{
521
494
foreach ($ commands as $ command ) {
522
495
$ this ->add ($ command );
@@ -528,10 +501,8 @@ public function addCommands(array $commands)
528
501
*
529
502
* If a command with the same name already exists, it will be overridden.
530
503
* If the command is not enabled it will not be added.
531
- *
532
- * @return Command|null
533
504
*/
534
- public function add (Command $ command )
505
+ public function add (Command $ command ): ? Command
535
506
{
536
507
$ this ->init ();
537
508
@@ -564,11 +535,9 @@ public function add(Command $command)
564
535
/**
565
536
* Returns a registered command by name or alias.
566
537
*
567
- * @return Command
568
- *
569
538
* @throws CommandNotFoundException When given command name does not exist
570
539
*/
571
- public function get (string $ name )
540
+ public function get (string $ name ): Command
572
541
{
573
542
$ this ->init ();
574
543
@@ -671,11 +640,9 @@ public function findNamespace(string $namespace): string
671
640
* Contrary to get, this command tries to find the best
672
641
* match if you give it an abbreviation of a name or alias.
673
642
*
674
- * @return Command
675
- *
676
643
* @throws CommandNotFoundException When command name is incorrect or ambiguous
677
644
*/
678
- public function find (string $ name )
645
+ public function find (string $ name ): Command
679
646
{
680
647
$ this ->init ();
681
648
@@ -783,7 +750,7 @@ public function find(string $name)
783
750
*
784
751
* @return Command[]
785
752
*/
786
- public function all (string $ namespace = null )
753
+ public function all (string $ namespace = null ): array
787
754
{
788
755
$ this ->init ();
789
756
@@ -924,10 +891,8 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo
924
891
925
892
/**
926
893
* Configures the input and output instances based on the user arguments and options.
927
- *
928
- * @return void
929
894
*/
930
- protected function configureIO (InputInterface $ input , OutputInterface $ output )
895
+ protected function configureIO (InputInterface $ input , OutputInterface $ output ): void
931
896
{
932
897
if (true === $ input ->hasParameterOption (['--ansi ' ], true )) {
933
898
$ output ->setDecorated (true );
@@ -992,7 +957,7 @@ protected function configureIO(InputInterface $input, OutputInterface $output)
992
957
*
993
958
* @return int 0 if everything went fine, or an error code
994
959
*/
995
- protected function doRunCommand (Command $ command , InputInterface $ input , OutputInterface $ output )
960
+ protected function doRunCommand (Command $ command , InputInterface $ input , OutputInterface $ output ): int
996
961
{
997
962
foreach ($ command ->getHelperSet () as $ helper ) {
998
963
if ($ helper instanceof InputAwareInterface) {
0 commit comments