Handler   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 4
eloc 8
c 3
b 0
f 0
dl 0
loc 25
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 11 4
1
<?php namespace Distilleries\Expendable\Exceptions;
2
3
use Exception;
4
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
5
6
class Handler extends ExceptionHandler {
7
8
    protected $dontReport = [
9
        'Symfony\Component\HttpKernel\Exception\HttpException',
10
        'Symfony\Component\HttpKernel\Exception\NotFoundHttpException'
11
    ];
12
13
    /**
14
     * Render an exception into an HTTP response.
15
     *
16
     * @param  \Illuminate\Http\Request $request
17
     * @param  \Exception $e
18
     * @return \Illuminate\Http\Response
19
     */
20 6
    public function render($request, Exception $e)
21
    {
22 6
        if ($this->isHttpException($e))
23
        {
24 6
            if ($request->segment(1) == config('expendable.admin_base_uri') && !config('app.debug'))
25
            {
26 2
                return app('Distilleries\Expendable\Http\Controllers\Backend\Base\ErrorController')->callAction("display", [$e, $e->getStatusCode()]);
0 ignored issues
show
Bug introduced by
The method getStatusCode() does not exist on Exception. It seems like you code against a sub-type of Exception such as Symfony\Component\HttpKe...Exception\HttpException. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
                return app('Distilleries\Expendable\Http\Controllers\Backend\Base\ErrorController')->callAction("display", [$e, $e->/** @scrutinizer ignore-call */ getStatusCode()]);
Loading history...
27
            }
28
        }
29
30 4
        return parent::render($request, $e);
31
    }
32
}