| Conditions | 2 |
| Paths | 3 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function create($json) |
||
| 16 | { |
||
| 17 | try { |
||
| 18 | $domainEventArray = json_decode($json, true); |
||
| 19 | return new DomainEvent($domainEventArray['origin'], $domainEventArray['name'], $domainEventArray['occurredOn'], $domainEventArray['body']); |
||
| 20 | } catch (\Exception $e) { |
||
| 21 | throw new InvalidJSONDomainEventException(); |
||
| 22 | } |
||
| 23 | } |
||
| 24 | |||
| 25 | } |