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.

Admin   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 11 4
1
<?php
2
3
namespace Afrittella\BackProject\Http\Middleware;
4
5
use Closure;
6
use Illuminate\Support\Facades\Auth;
7
8
class Admin
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, $guard = null)
18
    {
19
        if (Auth::guard($guard)->guest()) {
20
            if ($request->ajax() || $request->wantsJson()) {
21
                return response(trans('back-project::base.unauthorized'), 401);
0 ignored issues
show
Bug introduced by
It seems like trans('back-project::base.unauthorized') targeting trans() can also be of type object<Illuminate\Contra...Translation\Translator>; however, response() does only seem to accept string, maybe add an additional type check?

This check looks at variables that are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
22
            } else {
23
                return redirect()->guest('login');
24
            }
25
        }
26
        return $next($request);
27
    }
28
}
29