Completed
Pull Request — 2.x (#29)
by Akihito
01:35
created

TwigErrorPage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 24
ccs 0
cts 8
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __sleep() 0 4 1
A setRenderer() 0 4 1
1
<?php
2
/**
3
 * This file is part of the Madapaja.TwigModule package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace Madapaja\TwigModule;
8
9
use BEAR\Resource\RenderInterface;
10
use BEAR\Resource\ResourceObject;
11
use Ray\Di\Di\Inject;
12
use Ray\Di\Di\Named;
13
14
class TwigErrorPage extends ResourceObject
15
{
16
    /**
17
     * @var array
18
     */
19
    public $headers = [
20
        'content-type' => 'text/html; charset=utf-8'
21
    ];
22
    protected $renderer;
23
24
    public function __sleep()
25
    {
26
        return ['renderer'];
27
    }
28
29
    /**
30
     * @Inject
31
     * @Named("error_page")
32
     */
33
    public function setRenderer(RenderInterface $renderer)
34
    {
35
        $this->renderer = $renderer;
36
    }
37
}
38