| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.0416 |
| Changes | 0 | ||
| 1 | <?php |
||
| 52 | 4 | public function handle($request, Closure $next) |
|
|
1 ignored issue
–
show
|
|||
| 53 | { |
||
| 54 | 4 | if (backpack_auth()->guest()) { |
|
| 55 | return $this->respondToUnauthorizedRequest($request); |
||
| 56 | } |
||
| 57 | |||
| 58 | 4 | if (!$this->checkIfUserIsAdmin(backpack_user())) { |
|
| 59 | 1 | return $this->respondToUnauthorizedRequest($request); |
|
| 60 | } |
||
| 61 | |||
| 62 | 3 | return $next($request); |
|
| 63 | } |
||
| 65 |