| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 48 | private function executeEvent(AbstractEvent $event) |
||
| 49 | { |
||
| 50 | $eventName = ClassUtils::getShortName($event); |
||
| 51 | $method = sprintf('apply%s', (string) $eventName); |
||
| 52 | |||
| 53 | if (!method_exists($this, $method)) { |
||
| 54 | throw new BadMethodCallException( |
||
| 55 | sprintf( |
||
| 56 | 'You must define the %s::%s(%s $event) method in order to apply event named "%s".', |
||
| 57 | get_class($this), |
||
| 58 | $method, |
||
| 59 | get_class($event), |
||
| 60 | $eventName |
||
| 61 | ) |
||
| 62 | ); |
||
| 63 | } |
||
| 64 | |||
| 65 | $this->$method($event); |
||
| 66 | } |
||
| 67 | } |
||
| 68 |