Completed
Push — master ( bc6c17...74b7ca )
by Sergi Tur
11s
created

Handler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 3
c 3
b 0
f 0
lcom 0
cbo 0
dl 0
loc 40
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A report() 0 4 1
A render() 0 8 2
1
<?php
2
3
namespace Acacha\AdminLTETemplateLaravel\app\Exceptions;
4
5
use Exception;
6
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
7
8
class Handler extends ExceptionHandler
9
{
10
    /**
11
     * A list of the exception types that should not be reported.
12
     *
13
     * @var array
14
     */
15
    protected $dontReport = [
16
        'Symfony\Component\HttpKernel\Exception\HttpException',
17
    ];
18
19
    /**
20
     * Report or log an exception.
21
     *
22
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
23
     *
24
     * @param \Exception $e
25
     */
26
    public function report(Exception $e)
27
    {
28
        return parent::report($e);
29
    }
30
31
    /**
32
     * Render an exception into an HTTP response.
33
     *
34
     * @param \Illuminate\Http\Request $request
35
     * @param \Exception               $e
36
     *
37
     * @return \Illuminate\Http\Response
38
     */
39
    public function render($request, Exception $e)
40
    {
41
        if ($e instanceof NotFoundHttpException) {
0 ignored issues
show
Bug introduced by
The class Acacha\AdminLTETemplateL...s\NotFoundHttpException does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
42
            return response()->view('errors.404');
43
        }
44
45
        return parent::render($request, $e);
46
    }
47
}
48