| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | 19 | public function view(User $user, User $userModel): bool |
|
| 23 | { |
||
| 24 | 19 | if ($user->hasPermissionTo('user:view:any')) { |
|
| 25 | 10 | return true; |
|
| 26 | } |
||
| 27 | |||
| 28 | 9 | if (! $user->hasPermissionTo('user:view')) { |
|
| 29 | 1 | return false; |
|
| 30 | } |
||
| 31 | |||
| 32 | 8 | if ($user->id === $userModel->id) { |
|
| 33 | 6 | return true; |
|
| 34 | } |
||
| 35 | |||
| 36 | 2 | return false; |
|
| 37 | } |
||
| 100 |