Conditions | 2 |
Paths | 1 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | |||
10 | trait HandlesEvents |
||
11 | { |
||
12 | public function handles(): Collection |
||
13 | { |
||
14 | return $this->getEventHandlingMethods()->keys(); |
||
15 | } |
||
16 | |||
17 | public function handle(StoredEvent $storedEvent) |
||
18 | { |
||
19 | $eventClass = $storedEvent->event_class; |
||
20 | |||
21 | $handlerMethod = $this->getEventHandlingMethods()->get($eventClass); |
||
22 | |||
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: