Completed
Push — master ( 7b9015...c5b311 )
by Vladimir
26s queued 11s
created

CollectionItemFinalized   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 60%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getContentItem() 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\ContentItem;
11
use Symfony\Component\EventDispatcher\Event;
12
13
/**
14
 * This event is fired after a ContentItem has been finalized and tied to its respective parent PageViews. This event
15
 * grants readonly access to the object.
16
 *
17
 * @since 0.2.1
18
 */
19
class CollectionItemFinalized extends Event
20
{
21
    const NAME = 'collection.item.finalized';
22
23
    private $contentItem;
24
25 3
    public function __construct(&$contentItem)
26
    {
27 3
        $this->contentItem = &$contentItem;
28 3
    }
29
30
    /**
31
     * @return ContentItem
32
     */
33
    public function getContentItem()
34
    {
35
        return clone $this->contentItem;
36
    }
37
}
38