mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-14 10:20:34 +08:00
Add generics for all controllers (#20675)
This commit is contained in:
@@ -70,13 +70,19 @@ class UnknownCommandException extends Exception
|
||||
if ($help === false || $this->command === '') {
|
||||
return [];
|
||||
}
|
||||
/** @var HelpController $helpController */
|
||||
/**
|
||||
* @var HelpController $helpController
|
||||
* @phpstan-var HelpController<Application> $helpController
|
||||
*/
|
||||
list($helpController, $actionID) = $help;
|
||||
|
||||
$availableActions = [];
|
||||
foreach ($helpController->getCommands() as $command) {
|
||||
$result = $this->application->createController($command);
|
||||
/** @var Controller $controller */
|
||||
/**
|
||||
* @var Controller $controller
|
||||
* @phpstan-var Controller<Application> $controller
|
||||
*/
|
||||
list($controller, $actionID) = $result;
|
||||
if ($controller->createAction($controller->defaultAction) !== null) {
|
||||
// add the command itself (default action)
|
||||
|
||||
Reference in New Issue
Block a user