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

TwigErrorPageModule::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 7
cp 0
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
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\Sunday\Extension\Error\ErrorInterface;
11
use Madapaja\TwigModule\Annotation\TwigErrorPath;
12
use Ray\Di\AbstractModule;
13
14
class TwigErrorPageModule extends AbstractModule
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    protected function configure()
20
    {
21
        $this->bind(RenderInterface::class)->annotatedWith('error_page')->to(ErrorPagerRenderer::class);
22
        $this->bind(ErrorInterface::class)->to(TwigErrorHandler::class);
23
        $this->bind()->annotatedWith(TwigErrorPath::class)->toInstance('/error/error.html.twig');
24
        $this->bind(TwigErrorPage::class);
25
    }
26
}
27