Skip to content

Commit

Permalink
7
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Jan 7, 2024
1 parent 2b5933a commit 830aff2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Collector/Console/CommandCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function collect(ConsoleEvent|ConsoleErrorEvent|ConsoleTerminateEvent $ev

if ($event instanceof ConsoleTerminateEvent) {
$this->commands[$event::class] = [
'name' => $command->getName(),
'name' => $command?->getName() ?? $event->getInput()->getFirstArgument() ?? '',
'command' => $command,
'input' => $this->castInputToString($event->getInput()),
'output' => $this->fetchOutput($event->getOutput()),
Expand All @@ -68,13 +68,14 @@ public function collect(ConsoleEvent|ConsoleErrorEvent|ConsoleTerminateEvent $ev
return;
}

$definition = $command?->getDefinition();
$this->commands[$event::class] = [
'name' => $command->getName(),
'name' => $command?->getName() ?? $event->getInput()->getFirstArgument() ?? '',
'command' => $command,
'input' => $this->castInputToString($event->getInput()),
'output' => $this->fetchOutput($event->getOutput()),
'arguments' => $command->getDefinition()->getArguments(),
'options' => $command->getDefinition()->getOptions(),
'arguments' => $definition?->getArguments() ?? [],
'options' => $definition?->getOptions() ?? [],
];
}

Expand Down

0 comments on commit 830aff2

Please sign in to comment.