Completed
Pull Request — master (#86)
by Vladimir
38:05 queued 09:07
created

CompilerPreRenderDynamicPageView   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getCollectableItem() 0 4 1
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\CollectableItem;
11
use Symfony\Component\EventDispatcher\Event;
12
13
/**
14
 * This event is fired before a Dynamic PageView is rendered and allows you inject custom variables into the templates.
15
 *
16
 * @since 0.2.0
17
 */
18
class CompilerPreRenderDynamicPageView extends Event
19
{
20
    use CompilerPreRenderTrait;
21
22
    const NAME = 'compiler.prerender.dynamic_pageview';
23
24
    private $collectableItem;
25
26
    public function __construct(CollectableItem $collectable)
27
    {
28
        $this->collectableItem = $collectable;
29
    }
30
31
    public function getCollectableItem()
32
    {
33
        return clone $this->collectableItem;
34
    }
35
}
36