PugRendererFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 9
cts 9
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 9
nc 1
nop 1
crap 1
1
<?php
2
3
namespace InFw\Pug;
4
5
use Psr\Container\ContainerInterface;
6
use Pug\Pug;
7
8
class PugRendererFactory
9
{
10 1
    public function __invoke(ContainerInterface $container)
11
    {
12 1
        $config = $container->get('config');
13
14 1
        return new PugTemplateRenderer(
15 1
            $container->get(Pug::class),
16 1
            $config['pug']['default_params'],
17 1
            $config['pug']['globals'],
18 1
            array_merge(
19 1
                $config['templates'],
20
                [
21 1
                    'template_path' => $config['pug']['template_path']
22
                ]
23
            )
24
        );
25
    }
26
}
27