Add generics for all controllers (#20675)

This commit is contained in:
Maksim Spirkov
2025-11-03 12:59:23 +03:00
committed by GitHub
parent 0998ac6cb1
commit 7dd3dede14
36 changed files with 216 additions and 63 deletions

View File

@@ -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)