Skip to content

Commit

Permalink
Added docs for ProcessCollector
Browse files Browse the repository at this point in the history
  • Loading branch information
huangdijia authored Dec 2, 2024
1 parent 2b2286c commit 8d68398
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ProcessCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,28 @@
*/
class ProcessCollector
{
/**
* @var array<string, array<Process>>
*/
protected static array $processes = [];

public static function add($name, Process $process)
{
static::$processes[$name][] = $process;
}

/**
* @param string $name
* @return Process[]
*/
public static function get($name): array
{
return static::$processes[$name] ?? [];
}

/**
* @return Process[]
*/
public static function all(): array
{
$result = [];
Expand Down

0 comments on commit 8d68398

Please sign in to comment.