ErrorController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 12
dl 0
loc 30
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A display() 0 17 2
A initStaticPart() 0 3 1
1
<?php namespace Distilleries\Expendable\Http\Controllers\Backend\Base;
2
3
use \Exception;
4
5
class ErrorController extends BaseController {
6
7
8
    protected $layout = 'expendable::admin.layout.error';
9 2
    public function display(Exception $exception, $code)
10
    {
11 2
        $class = ($code == 404) ? 'page-404' : 'page-500';
12
13 2
        $content = view('expendable::admin.errors.default', [
14 2
            'code'    => $code,
15 2
            'class'    => $class,
16 2
            'message' => $exception->getMessage(),
17
        ]);
18
19
20 2
        $this->layoutManager->add([
21 2
            'class_layout'=>$class.'-full-page',
22 2
            'content'=>$content,
23
        ]);
24
25 2
        return response()->make($this->layoutManager->render(), $code);
26
    }
27
28
    // ------------------------------------------------------------------------------------------------
29
    // ------------------------------------------------------------------------------------------------
30
    // ------------------------------------------------------------------------------------------------
31
32 2
    protected function initStaticPart()
33
    {
34 2
        $this->layoutManager->initStaticPart();
35
    }
36
}