| 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 Event) { |
||
| 36 | throw new InvalidEventException(\sprintf( |
||
| 37 | 'Event collection only accepts %s, %s given', |
||
| 38 | Event::class, |
||
| 39 | \is_object($event) ? \get_class($event) : \gettype($event) |
||
| 40 | )); |
||
| 41 | } |
||
| 42 | |||
| 43 | $this->events[] = $event; |
||
| 44 | } |
||
| 45 | } |
||
| 46 | |||
| 99 |