diff --git a/framework/console/Controller.php b/framework/console/Controller.php index eb0bf63c99..c119dbdff9 100644 --- a/framework/console/Controller.php +++ b/framework/console/Controller.php @@ -291,11 +291,11 @@ class Controller extends \yii\base\Controller $class = new \ReflectionClass($this); } else { $action = $this->createAction($actionID); - $class = new \ReflectionClass($action); - } - - if ($action instanceof \yii\base\InlineAction) { - $class = new \ReflectionMethod($this, $action->actionMethod); + if ($action instanceof \yii\base\InlineAction) { + $class = new \ReflectionMethod($this, $action->actionMethod); + } else { + $class = new \ReflectionClass($action); + } } $docLines = preg_split('~\R~', $class->getDocComment()); @@ -320,11 +320,13 @@ class Controller extends \yii\base\Controller if ($actionID === null) { $class = new \ReflectionClass($this); } else { - $class = new \ReflectionClass($this->createAction($actionID)); - } + $action = $this->createAction($actionID); - if ($action instanceof \yii\base\InlineAction) { - $class = new \ReflectionMethod($this, $action->actionMethod); + if ($action instanceof \yii\base\InlineAction) { + $class = new \ReflectionMethod($this, $action->actionMethod); + } else { + $class = new \ReflectionClass($action); + } } $comment = strtr(trim(preg_replace('/^\s*\**( |\t)?/m', '', trim($class->getDocComment(), '/'))), "\r", ''); diff --git a/framework/console/controllers/HelpController.php b/framework/console/controllers/HelpController.php index c0e44775cd..a0c57bb553 100644 --- a/framework/console/controllers/HelpController.php +++ b/framework/console/controllers/HelpController.php @@ -40,7 +40,7 @@ class HelpController extends Controller { /** * Displays available commands or the detailed information - * about a particular command. For example, + * about a particular command. * * @param string $command The name of the command to show help about. * If not provided, all available commands will be displayed.