Total Complexity | 5 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | final class ReactableObserver |
||
19 | { |
||
20 | public function creating( |
||
21 | ReactableInterface $reactable, |
||
22 | ): void { |
||
23 | if ( |
||
24 | $this->shouldRegisterAsReactantOnCreate($reactable) |
||
25 | && $reactable->isNotRegisteredAsLoveReactant() |
||
26 | ) { |
||
27 | $reactable->registerAsLoveReactant(); |
||
28 | } |
||
29 | } |
||
30 | |||
31 | private function shouldRegisterAsReactantOnCreate( |
||
36 | } |
||
37 | } |
||
38 |