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

PageViewAdded::getPageView()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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
eloc 2
nc 1
nop 0
crap 2
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\Document\DynamicPageView;
12
use allejo\stakx\Document\RepeaterPageView;
13
use allejo\stakx\Document\StaticPageView;
14
use Symfony\Component\EventDispatcher\Event;
15
16
/**
17
 * This event is fired whenever a PageView is registered. This event grants access to the actual PageView object to
18
 * allow for any modifications necessary.
19
 *
20
 * @since 0.2.0
21
 */
22
class PageViewAdded extends Event
23
{
24
    const NAME = 'pageview.item.added';
25
26
    private $pageView;
27
28 17
    public function __construct(BasePageView &$pageView)
29
    {
30 17
        $this->pageView = &$pageView;
31 17
    }
32
33
    /**
34
     * @return BasePageView|DynamicPageView|RepeaterPageView|StaticPageView
35
     */
36
    public function &getPageView()
37
    {
38
        return $this->pageView;
39
    }
40
}
41