PageViewEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 26
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getPage() 0 3 1
1
<?php
2
/**
3
 * @copyright Zicht Online <http://zicht.nl>
4
 */
5
namespace Zicht\Bundle\PageBundle\Event;
6
7
use Symfony\Component\EventDispatcher\Event;
8
use Zicht\Bundle\PageBundle\Model\PageInterface;
9
10
/**
11
 * Event triggered whenever a page is loaded "for view" (PageManager::loadForView
12
 */
13
class PageViewEvent extends Event
14
{
15
    /**
16
     * @var PageInterface
17
     */
18
    private $page;
19
20
    /**
21
     * Constructs the event for the specified page.
22
     *
23
     * @param \Zicht\Bundle\PageBundle\Model\PageInterface $page
24
     */
25 6
    public function __construct(PageInterface $page)
26
    {
27 6
        $this->page = $page;
28 6
    }
29
30
31
    /**
32
     * Return the page attached to this event
33
     *
34
     * @return \Zicht\Bundle\PageBundle\Model\PageInterface
35
     */
36 3
    public function getPage()
37
    {
38 3
        return $this->page;
39
    }
40
}
41