Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
58 | protected function newEvent( |
||
59 | $event, |
||
60 | $target = null, |
||
61 | array $parameters = [] |
||
62 | )/*# : EventInterface */ { |
||
63 | if (is_object($event)) { |
||
64 | return $event; |
||
65 | } elseif (is_null($this->event_proto)) { |
||
66 | return new Event($event, $target, $parameters); |
||
67 | } else { |
||
68 | // clone the prototype |
||
69 | $evt = clone $this->event_proto; |
||
70 | $evt->setName($event); |
||
71 | $evt->setTarget($target); |
||
72 | $evt->setParams($parameters); |
||
73 | return $evt; |
||
74 | } |
||
75 | } |
||
76 | } |
||
77 |