Test Failed
Push — dev5 ( 054b32...4c0df5 )
by Ron
12:54
created

CheckBrowser   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 18
ccs 2
cts 4
cp 0.5
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 2
1
<?php
2
3
namespace App\Http\Middleware;
4
5
use Closure;
6
7
class CheckBrowser
8
{
9
    /**
10
     * Handle an incoming request.
11
     *
12
     * @param  \Illuminate\Http\Request  $request
13
     * @param  \Closure  $next
14
     * @return mixed
15
     */
16 568
    public function handle($request, Closure $next)
17
    {
18
        //  Check for Internet Explorer 11
19 568
        if (preg_match("/Trident\/7.0;(.*)rv:11.0/", $_SERVER["HTTP_USER_AGENT"], $match) != 0)
20
        {
21
            return response()->make(view('error.426'), 426);
22
        }
23
24
        return $next($request);
25
    }
26
}
27