Passed
Push — master ( 04a0d4...2a3a84 )
by Mahmoud
12:10 queued 07:56
created

IPBlocking   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 2
1
<?php
2
3
namespace App\Http\Middleware;
4
5
use Closure;
6
use App\IPBlocker;
7
8
class IPBlocking {
9
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param  \Illuminate\Http\Request  $request
14
     * @param  \Closure  $next
15
     * @return mixed
16
     */
17
    public function handle($request, Closure $next)
18
    {        
19
        if (IPBlocker::isBlocked()) {
20
            abort(403);
21
        }
22
        return $next($request);
23
    }
24
25
}