| Conditions | 3 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 3 | public function handle($request, Closure $next, $type = 'default') |
|
| 21 | { |
||
| 22 | 3 | $allowIPs = config('release-protection.ip.ips.' . $type, config('release-protection.ip.ips.default')); |
|
| 23 | if ( |
||
| 24 | 3 | app()->environment( |
|
|
|
|||
| 25 | 3 | config('release-protection.ip.envs.' . $type, config('release-protection.ip.envs.default')) |
|
| 26 | 3 | ) && |
|
| 27 | 3 | !in_array($request->ip(), $allowIPs) |
|
| 28 | ) { |
||
| 29 | 2 | abort( |
|
| 30 | 2 | config('release-protection.ip.status.restricted.' . $type, config('release-protection.ip.status.restricted.default')), |
|
| 31 | 2 | __(config('release-protection.ip.msg.restricted.' . $type, config('release-protection.ip.msg.restricted.default'))) |
|
| 32 | 2 | ); |
|
| 33 | } |
||
| 34 | |||
| 35 | 1 | return $next($request); |
|
| 36 | } |
||
| 38 |