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

CollectionItemAdded::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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\ContentItem;
11
use Symfony\Component\EventDispatcher\Event;
12
13
/**
14
 * This event is fired whenever a new ContentItem is created while processing a collection. This event grants access to
15
 * the ContentItem object allowing for any necessary modifications.
16
 *
17
 * @since 0.2.0
18
 */
19
class CollectionItemAdded extends Event
20
{
21
    const NAME = 'collection.item.added';
22
23
    private $contentItem;
24
25 36
    public function __construct(&$contentItem)
26
    {
27 36
        $this->contentItem = &$contentItem;
28 36
    }
29
30
    /**
31
     * @return ContentItem
32
     */
33
    public function &getContentItem()
34
    {
35
        return $this->contentItem;
36
    }
37
}
38