Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function handle(StoredEvent $storedEvent) |
||
18 | { |
||
19 | $eventClass = $storedEvent->event_class; |
||
20 | |||
21 | $handlerMethod = $this->getEventHandlingMethods()->get($eventClass); |
||
22 | |||
23 | if (! method_exists($this, $handlerMethod)) { |
||
24 | throw InvalidEventHandler::eventHandlingMethodDoesNotExist($this, $storedEvent->event, $handlerMethod); |
||
25 | } |
||
26 | |||
27 | app()->call([$this, $handlerMethod], [ |
||
28 | 'event' => $storedEvent->event, |
||
29 | 'storedEvent' => $storedEvent, |
||
30 | ]); |
||
31 | } |
||
32 | |||
50 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: