Browse Source

Fix phpcs error and add explicit returns

Mark Story 8 years ago
parent
commit
83683fb889
3 changed files with 9 additions and 4 deletions
  1. 4 2
      src/Command/HelpCommand.php
  2. 4 2
      src/Command/VersionCommand.php
  3. 1 0
      src/Shell/Task/CommandTask.php

+ 4 - 2
src/Command/HelpCommand.php

@@ -50,7 +50,7 @@ class HelpCommand extends Command implements CommandCollectionAwareInterface
      *
      * @param \Cake\Console\Arguments $args The command arguments.
      * @param \Cake\Console\ConsoleIo $io The console io
-     * @return int|null
+     * @return int
      */
     public function execute(Arguments $args, ConsoleIo $io)
     {
@@ -75,9 +75,11 @@ class HelpCommand extends Command implements CommandCollectionAwareInterface
         if ($args->getOption('xml')) {
             $this->asXml($io, $commands);
 
-            return;
+            return static::CODE_SUCCESS;
         }
         $this->asText($io, $commands);
+
+        return static::CODE_SUCCESS;
     }
 
     /**

+ 4 - 2
src/Command/VersionCommand.php

@@ -15,8 +15,8 @@
 namespace Cake\Command;
 
 use Cake\Console\Arguments;
-use Cake\Console\ConsoleIo;
 use Cake\Console\Command;
+use Cake\Console\ConsoleIo;
 use Cake\Core\Configure;
 
 /**
@@ -29,10 +29,12 @@ class VersionCommand extends Command
      *
      * @param \Cake\Console\Arguments $args The command arguments.
      * @param \Cake\Console\ConsoleIo $io The console io
-     * @return int|null
+     * @return int
      */
     public function execute(Arguments $args, ConsoleIo $io)
     {
         $io->out(Configure::version());
+
+        return static::CODE_SUCCESS;
     }
 }

+ 1 - 0
src/Shell/Task/CommandTask.php

@@ -75,6 +75,7 @@ class CommandTask extends Shell
     protected function _findShells($shellList, $path, $key, $skip)
     {
         $shells = $this->_scanDir($path);
+
         return $this->_appendShells($key, $shells, $shellList, $skip);
     }