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

TwigErrorPage::setRenderer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
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