@@ -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 ());
@@ -437,7 +437,7 @@ public function setVersion(string $version)
437
437
*
438
438
* @return string The long application version
439
439
*/
440
- public function getLongVersion ()
440
+ public function getLongVersion (): string
441
441
{
442
442
if ('UNKNOWN ' !== $ this ->getName ()) {
443
443
if ('UNKNOWN ' !== $ this ->getVersion ()) {
@@ -482,7 +482,7 @@ public function addCommands(array $commands)
482
482
*
483
483
* @return Command|null The registered command if enabled or null
484
484
*/
485
- public function add (Command $ command )
485
+ public function add (Command $ command ): ? Command
486
486
{
487
487
$ this ->init ();
488
488
@@ -519,7 +519,7 @@ public function add(Command $command)
519
519
*
520
520
* @throws CommandNotFoundException When given command name does not exist
521
521
*/
522
- public function get (string $ name )
522
+ public function get (string $ name ): Command
523
523
{
524
524
$ this ->init ();
525
525
@@ -626,11 +626,9 @@ public function findNamespace(string $namespace)
626
626
* Contrary to get, this command tries to find the best
627
627
* match if you give it an abbreviation of a name or alias.
628
628
*
629
- * @return Command
630
- *
631
629
* @throws CommandNotFoundException When command name is incorrect or ambiguous
632
630
*/
633
- public function find (string $ name )
631
+ public function find (string $ name ): Command
634
632
{
635
633
$ this ->init ();
636
634
@@ -740,7 +738,7 @@ public function find(string $name)
740
738
*
741
739
* @return Command[]
742
740
*/
743
- public function all (string $ namespace = null )
741
+ public function all (string $ namespace = null ): array
744
742
{
745
743
$ this ->init ();
746
744
@@ -939,7 +937,7 @@ protected function configureIO(InputInterface $input, OutputInterface $output)
939
937
*
940
938
* @return int 0 if everything went fine, or an error code
941
939
*/
942
- protected function doRunCommand (Command $ command , InputInterface $ input , OutputInterface $ output )
940
+ protected function doRunCommand (Command $ command , InputInterface $ input , OutputInterface $ output ): int
943
941
{
944
942
foreach ($ command ->getHelperSet () as $ helper ) {
945
943
if ($ helper instanceof InputAwareInterface) {
0 commit comments