Completed
Push — master ( 808f8c...952fde )
by Vladimir
11s
created

CompileProcessTemplateCreation   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 45.45%

Importance

Changes 0
Metric Value
wmc 4
lcom 2
cbo 1
dl 0
loc 39
ccs 5
cts 11
cp 0.4545
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getPageView() 0 4 1
A getTemplate() 0 4 1
A getTheme() 0 4 1
1
<?php
2
3
/**
4
 * @copyright 2018 Vladimir Jimenez
5
 * @license   https://github.com/allejo/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 CompileProcessTemplateCreation extends Event
20
{
21
    const NAME = 'compile.process.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
    /**
35
     * @return BasePageView
36
     */
37
    public function getPageView()
38
    {
39
        return clone $this->pageView;
40
    }
41
42
    /**
43
     * @return TemplateInterface
44
     */
45
    public function getTemplate()
46
    {
47
        return clone $this->template;
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function getTheme()
54
    {
55
        return $this->theme;
56
    }
57
}
58