| Conditions | 6 |
| Paths | 24 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function __construct($event = null, $target = null, array $values = []) |
||
| 29 | { |
||
| 30 | parent::__construct(); |
||
| 31 | |||
| 32 | // event class as default event name |
||
| 33 | $event or $event = get_class($this); |
||
| 34 | |||
| 35 | // init event from string or object |
||
| 36 | if (is_string($event)) { |
||
| 37 | $this->setName($event); |
||
| 38 | } elseif ($event instanceof EventInterface) { |
||
| 39 | $this->setTarget($event->getTarget()); |
||
| 40 | $this->exchangeArray($event->getArrayCopy()); |
||
| 41 | } |
||
| 42 | |||
| 43 | // set event target and parameters if any |
||
| 44 | $target and $this->setTarget($target); |
||
| 45 | $values and $this->exchangeArray($values); |
||
| 46 | } |
||
| 48 |