Conditions | 5 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | public function __construct($eventNames) |
||
31 | { |
||
32 | foreach ($eventNames as $eventName) { |
||
33 | if (!is_string($eventName) || empty($eventName)) { |
||
34 | throw InvalidArgumentException::invalidType('non-empty string', 'eventName', $eventName); |
||
35 | } |
||
36 | |||
37 | if (!class_exists($eventName)) { |
||
38 | throw new InvalidArgumentException(sprintf( |
||
39 | 'Cannot create EventCollection: class "%s" does not exist', |
||
40 | $eventName |
||
41 | )); |
||
42 | } |
||
43 | |||
44 | $this->eventNames[] = $eventName; |
||
45 | } |
||
46 | } |
||
47 | } |
||
48 |