Fixes #12807: Added console controller checks for yii\console\controllers\HelpController

This commit is contained in:
Tobias Munk
2016-10-23 13:02:59 +02:00
committed by Alexander Makarov
parent bbdf5186d2
commit 02e0ac7034
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ Yii Framework 2 Change Log
- Bug #12791: Fixed `yii\behaviors\AttributeTypecastBehavior` unable to automatically detect `attributeTypes`, triggering PHP Fatal Error (klimov-paul) - Bug #12791: Fixed `yii\behaviors\AttributeTypecastBehavior` unable to automatically detect `attributeTypes`, triggering PHP Fatal Error (klimov-paul)
- Enh #12790: Added `scrollToErrorOffset` option for `ActiveForm` which adds ability to specify offset in pixels when scrolling to error (mg-code) - Enh #12790: Added `scrollToErrorOffset` option for `ActiveForm` which adds ability to specify offset in pixels when scrolling to error (mg-code)
- Enh #12807: Added console controller checks for `yii\console\controllers\HelpController` (schmunk42)
2.0.10 October 20, 2016 2.0.10 October 20, 2016
----------------------- -----------------------

View File

@ -90,7 +90,7 @@ class HelpController extends Controller
$description = ''; $description = '';
$result = Yii::$app->createController($command); $result = Yii::$app->createController($command);
if ($result !== false) { if ($result !== false && $result[0] instanceof Controller) {
list($controller, $actionID) = $result; list($controller, $actionID) = $result;
/** @var Controller $controller */ /** @var Controller $controller */
$description = $controller->getHelpSummary(); $description = $controller->getHelpSummary();
@ -188,7 +188,7 @@ class HelpController extends Controller
$len = 0; $len = 0;
foreach ($commands as $command => $description) { foreach ($commands as $command => $description) {
$result = Yii::$app->createController($command); $result = Yii::$app->createController($command);
if ($result !== false) { if ($result !== false && $result[0] instanceof Controller) {
/** @var $controller Controller */ /** @var $controller Controller */
list($controller, $actionID) = $result; list($controller, $actionID) = $result;
$actions = $this->getActions($controller); $actions = $this->getActions($controller);
@ -215,7 +215,7 @@ class HelpController extends Controller
$this->stdout("\n"); $this->stdout("\n");
$result = Yii::$app->createController($command); $result = Yii::$app->createController($command);
if ($result !== false) { if ($result !== false && $result[0] instanceof Controller) {
list($controller, $actionID) = $result; list($controller, $actionID) = $result;
$actions = $this->getActions($controller); $actions = $this->getActions($controller);
if (!empty($actions)) { if (!empty($actions)) {