Completed
Pull Request — master (#67)
by Vladimir
02:34
created

PageViewAdded   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 19
ccs 3
cts 5
cp 0.6
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getPageView() 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\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