Total Complexity | 4 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | final class ReactionObserver |
||
21 | { |
||
22 | public function creating( |
||
23 | Reaction $reaction |
||
24 | ): void { |
||
25 | if (is_null($reaction->getAttributeValue('rate'))) { |
||
26 | $reaction->setAttribute('rate', Reaction::DEFAULT_RATE); |
||
27 | } |
||
28 | } |
||
29 | |||
30 | public function created( |
||
31 | Reaction $reaction |
||
32 | ): void { |
||
33 | event(new ReactionHasBeenAdded($reaction)); |
||
34 | } |
||
35 | |||
36 | public function deleted( |
||
40 | } |
||
41 | } |
||
42 |