Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function handle(Event $event, Projector $projector): bool |
||
32 | { |
||
33 | $classNamespaces = explode("\\", get_class($event)); |
||
34 | $eventName = end($classNamespaces); |
||
35 | $methodName = "when{$eventName}"; |
||
36 | if (method_exists($projector, $methodName)) { |
||
37 | $projector->$methodName($event); |
||
38 | return true; |
||
39 | } |
||
40 | |||
41 | return false; |
||
42 | } |
||
43 | } |
||
44 |