Matthias\SymfonyConsoleForm\Console\EventListener\SetInputDefinitionOfFormBasedCommandEventListener::getCommandFromHelpCommand PHP Метод

getCommandFromHelpCommand() приватный Метод

private getCommandFromHelpCommand ( HelpCommand $helpCommand ) : Command | null
$helpCommand Symfony\Component\Console\Command\HelpCommand
Результат Symfony\Component\Console\Command\Command | null
    private function getCommandFromHelpCommand(HelpCommand $helpCommand)
    {
        // hackish way of retrieving the command for which help was asked
        $reflectionObject = new \ReflectionObject($helpCommand);
        $commandProperty = $reflectionObject->getProperty('command');
        $commandProperty->setAccessible(true);
        return $commandProperty->getValue($helpCommand);
    }