ThemeLoader::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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