Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
40 | 2 | public function __invoke(Environment $env): void |
|
41 | { |
||
42 | 2 | $project = $env->workingDirectory(); |
|
43 | 2 | $agents = $this->manager; |
|
44 | |||
45 | 2 | foreach ($this->agents as $agent) { |
|
46 | $agents = $agents->schedule(static function() use ($agent, $project): void { |
||
47 | 2 | $agent($project); |
|
48 | 2 | }); |
|
49 | } |
||
50 | |||
51 | 2 | $agents = $agents(); |
|
52 | 2 | ($this->trigger)( |
|
53 | 2 | new Activity(Type::start(), []), |
|
54 | 1 | $env |
|
55 | ); |
||
56 | |||
57 | $this->ipc->listen($this->name)(function(Message $message) use ($env): void { |
||
58 | 2 | $activity = $this->protocol->decode($message); |
|
59 | 2 | ($this->trigger)($activity, $env); |
|
60 | 2 | }); |
|
61 | |||
62 | 2 | $agents->kill(); |
|
63 | 2 | } |
|
65 |