Completed
Pull Request — master (#86)
by Vladimir
02:09
created

CompilerTemplateCreation::getPageView()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
/**
4
 * @copyright 2018 Vladimir Jimenez
5
 * @license   https://github.com/stakx-io/stakx/blob/master/LICENSE.md MIT
6
 */
7
8
namespace allejo\stakx\Event;
9
10
use allejo\stakx\Document\BasePageView;
11
use allejo\stakx\Templating\TemplateInterface;
12
use Symfony\Component\EventDispatcher\Event;
13
14
/**
15
 * A notification only event for when a template is created by the Compiler.
16
 *
17
 * @since 0.2.0
18
 */
19
class CompilerTemplateCreation extends Event
20
{
21
    const NAME = 'compile.template_creation';
22
23
    private $pageView;
24
    private $template;
25
    private $theme;
26
27 12
    public function __construct(BasePageView $pageView, TemplateInterface $template, $theme)
28
    {
29 12
        $this->pageView = $pageView;
30 12
        $this->template = $template;
31 12
        $this->theme = $theme;
32 12
    }
33
34
    public function getPageView()
35
    {
36
        return clone $this->pageView;
37
    }
38
39
    public function getTemplate()
40
    {
41
        return clone $this->template;
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getTheme()
48
    {
49
        return $this->theme;
50
    }
51
}
52