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::report()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace App\Exceptions;
4
5
use Exception;
6
use Illuminate\Database\Eloquent\ModelNotFoundException;
7
use Symfony\Component\HttpKernel\Exception\HttpException;
8
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
9
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
10
11
class Handler extends ExceptionHandler
12
{
13
    /**
14
     * A list of the exception types that should not be reported.
15
     *
16
     * @var array
17
     */
18
    protected $dontReport = [
19
        HttpException::class,
20
        ModelNotFoundException::class,
21
    ];
22
23
    /**
24
     * Report or log an exception.
25
     *
26
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
27
     *
28
     * @param  \Exception  $e
29
     * @return void
30
     */
31
    public function report(Exception $e)
32
    {
33
        return parent::report($e);
34
    }
35
36
    /**
37
     * Render an exception into an HTTP response.
38
     *
39
     * @param  \Illuminate\Http\Request  $request
40
     * @param  \Exception  $e
41
     * @return \Illuminate\Http\Response
42
     */
43
    public function render($request, Exception $e)
44
    {
45
        if ($e instanceof ModelNotFoundException) {
46
            $e = new NotFoundHttpException($e->getMessage(), $e);
47
        }
48
49
        return parent::render($request, $e);
50
    }
51
}
52