Handler   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 45
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\Auth\Access\AuthorizationException;
7
use Illuminate\Database\Eloquent\ModelNotFoundException;
8
use Illuminate\Validation\ValidationException;
9
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
10
use Symfony\Component\HttpKernel\Exception\HttpException;
11
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
12
13
/**
14
 * Class Handler.
15
 */
16
class Handler extends ExceptionHandler
17
{
18
    /**
19
     * A list of the exception types that should not be reported.
20
     *
21
     * @var array
22
     */
23
    protected $dontReport = [
24
        AuthorizationException::class,
25
        HttpException::class,
26
        ModelNotFoundException::class,
27
        ValidationException::class,
28
    ];
29
30
    /**
31
     * Report or log an exception.
32
     *
33
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
34
     *
35
     * @param \Exception $e
36
     *
37
     * @return void
38
     */
39
    public function report(Exception $e)
40
    {
41
        parent::report($e);
42
    }
43
44
    /**
45
     * Render an exception into an HTTP response.
46
     *
47
     * @param \Illuminate\Http\Request $request
48
     * @param \Exception               $e
49
     *
50
     * @return \Illuminate\Http\Response
51
     */
52
    public function render($request, Exception $e)
53
    {
54
        if ($e instanceof NotFoundHttpException) {
55
            return response(view('habbo-web-pages.habbo-web'));
0 ignored issues
show
Bug Compatibility introduced by
The expression response(view('habbo-web-pages.habbo-web')); of type Laravel\Lumen\Http\Respo...lluminate\Http\Response adds the type Laravel\Lumen\Http\ResponseFactory to the return on line 55 which is incompatible with the return type declared by the interface Illuminate\Contracts\Deb...xceptionHandler::render of type Symfony\Component\HttpFoundation\Response.
Loading history...
56
        }
57
58
        return parent::render($request, $e);
59
    }
60
}
61