Completed
Push — master ( 5d7b87...24188c )
by David
14s
created

TwigThemeDescriptor::getConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace TheCodingMachine\CMS\Theme;
5
6
7
class TwigThemeDescriptor implements ThemeDescriptorInterface, \JsonSerializable
8
{
9
    /**
10
     * @var string
11
     */
12
    private $template;
13
14
    /**
15
     * @var mixed[]
16
     */
17
    private $config;
18
19
    /**
20
     * @param string $template The Twig resource to be loaded
21
     * @param mixed[] $config An array of configuration options that will be passed to the TwigTheme. Can be used to register parameters for the extensions, ... For instance, use the "theme" key to specify the theme used.
22
     */
23
    public function __construct(string $template, array $config)
24
    {
25
        $this->template = $template;
26
        $this->config = $config;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function getTemplate(): string
33
    {
34
        return $this->template;
35
    }
36
37
    /**
38
     * @return mixed[]
39
     */
40
    public function getConfig(): array
41
    {
42
        return $this->config;
43
    }
44
45
    public function jsonSerialize()
46
    {
47
        return [
48
            'type' => 'twig',
49
            'template' => $this->template,
50
            'config' => $this->config,
51
        ];
52
    }
53
}
54