(strpos($command->getName(), ':')?:0)
);
$commandData = $command->getApplication()->getData();
- $commands = $commandData['commands'][$namespace];
$examples = [];
- foreach ($commands as $item) {
- if ($item['name'] == $command->getName()) {
- $examples = $item['examples'];
- break;
+ if (array_key_exists($namespace, $commandData['commands'])) {
+ $commands = $commandData['commands'][$namespace];
+ foreach ($commands as $item) {
+ if ($item['name'] == $command->getName()) {
+ $examples = $item['examples'];
+ break;
+ }
}
}