Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types = 1); |
||
7 | 4 | public function build(string $namespace, array $event): Event |
|
8 | { |
||
9 | 4 | $eventType = $namespace . '\\' . $event['type']; |
|
10 | |||
11 | 4 | if (!$this->isValidType($eventType)) { |
|
12 | 2 | throw new UnknownEventException($event['type']); |
|
13 | } |
||
14 | |||
15 | 2 | return new $eventType($event); |
|
16 | } |
||
17 | |||
23 |