| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 50 | 6 | public function dispatch($signal, ...$arguments): Task |
|
| 51 | { |
||
| 52 | 6 | if (\is_object($signal)) { |
|
| 53 | 1 | \array_unshift($arguments, $signal); |
|
| 54 | |||
| 55 | 1 | $signal = \get_class($signal); |
|
| 56 | } |
||
| 57 | |||
| 58 | 6 | $handler = $this->handlers[$signal] ?? static function () use ($signal) { |
|
| 59 | 1 | throw new Exception\UnknownSignal($signal); |
|
| 60 | 6 | }; |
|
| 61 | |||
| 62 | 6 | return $this->processor->execute($handler, $arguments); |
|
| 63 | } |
||
| 65 |