GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Setup Failed
Push — master ( f88331...3d4ba4 )
by Nikhil
17:08 queued 06:47
created

Authenticate::handle()   A

Complexity

Conditions 4
Paths 3

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
ccs 0
cts 11
cp 0
rs 9.2
cc 4
eloc 7
nc 3
nop 3
crap 20
1
<?php
2
3
namespace App\Http\Middleware;
4
5
use Closure;
6
use Illuminate\Support\Facades\Auth;
7
8
class Authenticate
9
{
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param  \Illuminate\Http\Request  $request
14
     * @param  \Closure  $next
15
     * @param  string|null  $guard
16
     * @return mixed
17
     */
18
    public function handle($request, Closure $next, $guard = null)
19
    {
20
        if (Auth::guard($guard)->guest()) {
21
            if ($request->ajax() || $request->wantsJson()) {
22
                return response('Unauthorized.', 401);
23
            } else {
24
                return redirect()->guest('login');
25
            }
26
        }
27
28
        return $next($request);
29
    }
30
}
31