Conditions | 4 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 6.9849 |
Changes | 0 |
1 | <?php |
||
25 | public function handle(UserUpdated $event) : void |
||
26 | 1 | { |
|
27 | if ($event->user->isManager() || |
||
28 | 1 | $event->user->isAdmin() |
|
29 | 1 | ) { |
|
30 | $managerProfile = Manager::where('user_id', $event->user->id)->first(); |
||
31 | if ($managerProfile === null) { |
||
32 | $managerProfile = new Manager(); |
||
33 | $managerProfile->user_id = $event->user->id; |
||
34 | $managerProfile->save(); |
||
35 | } |
||
39 |