Skip to content

Commit

Permalink
17
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Dec 19, 2024
1 parent 71645c4 commit 334a3a4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Collector/Console/CommandCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use Yiisoft\Yii\Debug\Collector\SummaryCollectorInterface;
use Yiisoft\Yii\Debug\Collector\TimelineCollector;

use function array_key_exists;

final class CommandCollector implements SummaryCollectorInterface
{
use CollectorTrait;
Expand All @@ -23,6 +25,19 @@ final class CommandCollector implements SummaryCollectorInterface
* Let -1 mean that it was not set during the process.
*/
private const UNDEFINED_EXIT_CODE = -1;

/**
* @psalm-var array<string, array{
* name: string,
* command: Command|null,
* input: string|null,
* output: string|null,
* error?: string,
* exitCode?: int,
* arguments?: array,
* options?: array,
* }>
*/
private array $commands = [];

public function __construct(
Expand Down Expand Up @@ -127,6 +142,9 @@ private function castInputToString(InputInterface $input): ?string
return method_exists($input, '__toString') ? $input->__toString() : null;
}

/**
* @return string[]
*/
private function getSupportedEvents(): array
{
return [
Expand Down

0 comments on commit 334a3a4

Please sign in to comment.