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.

Handler   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A report() 0 4 1
A render() 0 4 1
A unauthenticated() 0 8 2
1
<?php
2
3
namespace App\Exceptions;
4
5
use Exception;
6
use Illuminate\Auth\AuthenticationException;
7
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
8
9
class Handler extends ExceptionHandler
10
{
11
    /**
12
     * A list of the exception types that should not be reported.
13
     *
14
     * @var array
15
     */
16
    protected $dontReport = [
17
        \Illuminate\Auth\AuthenticationException::class,
18
        \Illuminate\Auth\Access\AuthorizationException::class,
19
        \Symfony\Component\HttpKernel\Exception\HttpException::class,
20
        \Illuminate\Database\Eloquent\ModelNotFoundException::class,
21
        \Illuminate\Session\TokenMismatchException::class,
22
        \Illuminate\Validation\ValidationException::class,
23
    ];
24
25
    /**
26
     * Report or log an exception.
27
     *
28
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
29
     *
30
     * @param  \Exception  $exception
31
     * @return void
32
     */
33
    public function report(Exception $exception)
34
    {
35
        parent::report($exception);
36
    }
37
38
    /**
39
     * Render an exception into an HTTP response.
40
     *
41
     * @param  \Illuminate\Http\Request  $request
42
     * @param  \Exception  $exception
43
     * @return \Illuminate\Http\Response
44
     */
45
    public function render($request, Exception $exception)
46
    {
47
        return parent::render($request, $exception);
48
    }
49
50
    /**
51
     * Convert an authentication exception into an unauthenticated response.
52
     *
53
     * @param  \Illuminate\Http\Request  $request
54
     * @param  \Illuminate\Auth\AuthenticationException  $exception
55
     * @return \Illuminate\Http\Response
56
     */
57
    protected function unauthenticated($request, AuthenticationException $exception)
0 ignored issues
show
Unused Code introduced by
The parameter $exception is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
58
    {
59
        if ($request->expectsJson()) {
60
            return response()->json(['error' => 'Unauthenticated.'], 401);
61
        }
62
63
        return redirect()->guest('login');
64
    }
65
}
66