Completed
Push — master ( 188ffb...31684b )
by Maxime
02:48
created

ErrorController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A display() 0 18 2
A initStaticPart() 0 4 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
    public function display(Exception $exception, $code)
10
    {
11
        $class = ($code == 404) ? 'page-404' : 'page-500';
12
13
        $content = view('expendable::admin.errors.default', [
14
            'code'    => $code,
15
            'class'    => $class,
16
            'message' => $exception->getMessage(),
17
        ]);
18
19
20
        $this->layoutManager->add([
21
            'class_layout'=>$class . '-full-page',
22
            'content'=>$content,
23
        ]);
24
25
        return response()->make($this->layoutManager->render(), $code);
26
    }
27
28
    // ------------------------------------------------------------------------------------------------
29
    // ------------------------------------------------------------------------------------------------
30
    // ------------------------------------------------------------------------------------------------
31
32
    protected function initStaticPart()
33
    {
34
        $this->layoutManager->initStaticPart();
35
    }
36
}