@@ -213,7 +213,7 @@ public function run(InputInterface $input = null, OutputInterface $output = null
213
213
*
214
214
* @return int 0 if everything went fine, or an error code
215
215
*/
216
- public function doRun (InputInterface $ input , OutputInterface $ output )
216
+ public function doRun (InputInterface $ input , OutputInterface $ output ): int
217
217
{
218
218
if (true === $ input ->hasParameterOption (['--version ' , '-V ' ], true )) {
219
219
$ output ->writeln ($ this ->getLongVersion ());
@@ -420,10 +420,8 @@ public function setVersion(string $version)
420
420
421
421
/**
422
422
* Returns the long version of the application.
423
- *
424
- * @return string
425
423
*/
426
- public function getLongVersion ()
424
+ public function getLongVersion (): string
427
425
{
428
426
if ('UNKNOWN ' !== $ this ->getName ()) {
429
427
if ('UNKNOWN ' !== $ this ->getVersion ()) {
@@ -463,10 +461,8 @@ public function addCommands(array $commands)
463
461
*
464
462
* If a command with the same name already exists, it will be overridden.
465
463
* If the command is not enabled it will not be added.
466
- *
467
- * @return Command|null
468
464
*/
469
- public function add (Command $ command )
465
+ public function add (Command $ command ): ? Command
470
466
{
471
467
$ this ->init ();
472
468
@@ -499,11 +495,9 @@ public function add(Command $command)
499
495
/**
500
496
* Returns a registered command by name or alias.
501
497
*
502
- * @return Command
503
- *
504
498
* @throws CommandNotFoundException When given command name does not exist
505
499
*/
506
- public function get (string $ name )
500
+ public function get (string $ name ): Command
507
501
{
508
502
$ this ->init ();
509
503
@@ -606,11 +600,9 @@ public function findNamespace(string $namespace): string
606
600
* Contrary to get, this command tries to find the best
607
601
* match if you give it an abbreviation of a name or alias.
608
602
*
609
- * @return Command
610
- *
611
603
* @throws CommandNotFoundException When command name is incorrect or ambiguous
612
604
*/
613
- public function find (string $ name )
605
+ public function find (string $ name ): Command
614
606
{
615
607
$ this ->init ();
616
608
@@ -720,7 +712,7 @@ public function find(string $name)
720
712
*
721
713
* @return Command[]
722
714
*/
723
- public function all (string $ namespace = null )
715
+ public function all (string $ namespace = null ): array
724
716
{
725
717
$ this ->init ();
726
718
@@ -919,7 +911,7 @@ protected function configureIO(InputInterface $input, OutputInterface $output)
919
911
*
920
912
* @return int 0 if everything went fine, or an error code
921
913
*/
922
- protected function doRunCommand (Command $ command , InputInterface $ input , OutputInterface $ output )
914
+ protected function doRunCommand (Command $ command , InputInterface $ input , OutputInterface $ output ): int
923
915
{
924
916
foreach ($ command ->getHelperSet () as $ helper ) {
925
917
if ($ helper instanceof InputAwareInterface) {
0 commit comments