| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 15 | public function handle(Request $request, Closure $next, string $strategy, string $countries, string $callback = null) |
|
| 27 | { |
||
| 28 | 15 | $this->countries = explode('&', $countries); |
|
| 29 | 15 | $this->strategy = $strategy; |
|
| 30 | |||
| 31 | 15 | if ($this->shouldHaveAccess($request)) { |
|
| 32 | 3 | return $next($request); |
|
| 33 | } |
||
| 34 | |||
| 35 | 12 | if ($callback && $callback = unserialize($callback)) { |
|
| 36 | 7 | return call_user_func_array($callback[0], $callback[1] ?? []); |
|
| 37 | } |
||
| 38 | |||
| 39 | 5 | return abort(401); |
|
| 40 | } |
||
| 62 |