PageViewEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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