ThemeLoader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A load() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the takeit/AmpHtmlBundle package.
5
 *
6
 * (c) Rafał Muszyński <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Takeit\Bundle\AmpHtmlBundle\Loader;
13
14
use Twig\Loader\FilesystemLoader;
15
16
final class ThemeLoader implements ThemeLoaderInterface
17
{
18
    /**
19
     * @var FilesystemLoader
20
     */
21
    private $filesystem;
22
23
    /**
24
     * @var string
25
     */
26
    private $themePath;
27
28
    /**
29
     * @param FilesystemLoader $filesystem
30
     * @param $themePath
31
     */
32
    public function __construct(FilesystemLoader $filesystem, $themePath)
33
    {
34
        $this->filesystem = $filesystem;
35
        $this->themePath = $themePath;
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function load()
42
    {
43
        $this->filesystem->addPath($this->themePath, ThemeLoaderInterface::THEME_NAMESPACE);
44
    }
45
}
46