PugRendererFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 14
ccs 9
cts 9
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 12 1
1
<?php
2
3
namespace Antidot\Render\Phug\Container;
4
5
use Antidot\Render\Phug\Container\Config\PugConfig;
6
use Antidot\Render\Phug\PugTemplateRenderer;
7
use Antidot\Render\TemplateRenderer;
8
use Psr\Container\ContainerInterface;
9
use Pug\Pug;
10
11
class PugRendererFactory
12
{
13 1
    public function __invoke(ContainerInterface $container): TemplateRenderer
14
    {
15 1
        $pugConfig = PugConfig::createFromAntidotConfig($container->get('config'));
16
17 1
        return new PugTemplateRenderer(
18 1
            $container->get(Pug::class),
19 1
            $pugConfig->get('default_params'),
20 1
            $pugConfig->get('globals'),
21 1
            array_merge(
22 1
                $pugConfig->templates(),
23
                [
24 1
                    'template_path' => $pugConfig->get('template_path')
25
                ]
26
            )
27
        );
28
    }
29
}
30