| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | private function invokeEventHandler(DomainEventInterface $event): ProjectionInterface |
||
| 38 | { |
||
| 39 | $handlerName = preg_replace('/Event$/', '', (new \ReflectionClass($event))->getShortName()); |
||
| 40 | $handlerMethod = 'when'.ucfirst($handlerName); |
||
| 41 | $handler = [$this, $handlerMethod]; |
||
| 42 | if (!is_callable($handler)) { |
||
| 43 | throw new DbalException("Handler '$handlerMethod' is not callable on ".self::class); |
||
| 44 | } |
||
| 45 | return call_user_func($handler, $event); |
||
| 46 | } |
||
| 47 | |||
| 53 |