Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function __construct(array $events) |
||
33 | { |
||
34 | foreach ($events as $event) { |
||
35 | if (!$event instanceof AggregateEvent) { |
||
36 | throw new InvalidAggregateEventException(\sprintf( |
||
37 | 'Aggregate event stream only accepts %s, %s given', |
||
38 | AggregateEvent::class, |
||
39 | \is_object($event) ? \get_class($event) : \gettype($event) |
||
40 | )); |
||
41 | } |
||
42 | |||
43 | $this->events[] = $event; |
||
44 | } |
||
45 | } |
||
46 | |||
91 |