DwooEngineDecorator   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 3
1
<?php
2
/**
3
 * Copyright (c) 2017
4
 *
5
 * @package   Majima
6
 * @author    David Neustadt <[email protected]>
7
 * @copyright 2017 David Neustadt
8
 * @license   MIT
9
 */
10
11
namespace Majima\PluginBundle\Services;
12
13
use Majima\Services\ConfigService;
14
use Majima\Services\DwooEngineFactory;
15
use Symfony\Component\DependencyInjection\Container;
16
17
/**
18
 * Class DwooEngineDecorator
19
 * @package Majima\PluginBundle\Services
20
 */
21
class DwooEngineDecorator extends DwooEngineFactory
22
{
23
    /**
24
     * DwooEngineDecorator constructor.
25
     * @param DwooEngineFactory $engine
26
     * @param Container $container
27
     * @param ConfigService $config
28
     */
29
    public function __construct(
30
        DwooEngineFactory $engine,
31
        Container $container,
32
        ConfigService $config
33
    )
34
    {
35
        parent::__construct($container, $config);
36
37
        $pluginResourcesDirs = $container->getParameter('plugins.view.dirs');
38
39
        foreach ($pluginResourcesDirs as $pluginResourcesDir) {
40
            $viewsDir = $pluginResourcesDir;
41
            if (!is_dir($viewsDir)) {
42
                continue;
43
            }
44
            $this->setTemplateDir($viewsDir);
45
        }
46
    }
47
}