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 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 41
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A report() 0 4 1
A render() 0 8 2
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