Handler   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 49
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 6 2
A report() 0 3 1
1
<?php
2
3
namespace App\Exceptions;
4
5
use App\Src\UseCases\Domain\Exceptions\NotFound;
6
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
7
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
8
use Throwable;
9
10
class Handler extends ExceptionHandler
11
{
12
    /**
13
     * A list of the exception types that are not reported.
14
     *
15
     * @var array
16
     */
17
    protected $dontReport = [
18
        //
19
    ];
20
21
    /**
22
     * A list of the inputs that are never flashed for validation exceptions.
23
     *
24
     * @var array
25
     */
26
    protected $dontFlash = [
27
        'password',
28
        'password_confirmation',
29
    ];
30
31
    /**
32
     * Report or log an exception.
33
     *
34
     * @param  \Throwable  $exception
35
     * @return void
36
     *
37
     * @throws \Exception
38
     */
39
    public function report(Throwable $exception)
40
    {
41
        parent::report($exception);
42
    }
43
44
    /**
45
     * Render an exception into an HTTP response.
46
     *
47
     * @param  \Illuminate\Http\Request  $request
48
     * @param  \Throwable  $exception
49
     * @return \Symfony\Component\HttpFoundation\Response
50
     *
51
     * @throws \Throwable
52
     */
53
    public function render($request, Throwable $exception)
54
    {
55
        if ($exception instanceof NotFound) {
56
            throw new NotFoundHttpException();
57
        }
58
        return parent::render($request, $exception);
59
    }
60
}
61