Completed
Push — master ( 808f8c...952fde )
by Vladimir
11s
created

CollectableItemTrait::setParentPageView()   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/stakx-io/stakx/blob/master/LICENSE.md MIT
6
 */
7
8
namespace allejo\stakx\Document;
9
10
/**
11
 * This trait implements the methods required by the `CollectableItem` interface.
12
 */
13
trait CollectableItemTrait
14
{
15
    /** @var string */
16
    protected $namespace;
17
18
    /** @var DynamicPageView[] */
19
    protected $parentPageViews;
20
21
    /**
22
     * {@inheritdoc}
23
     */
24 24
    public function getNamespace()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
25
    {
26 24
        return $this->namespace;
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 38
    public function setNamespace($namespace)
33
    {
34 38
        $this->namespace = $namespace;
35 38
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function &getParentPageViews()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
41
    {
42
        return $this->parentPageViews;
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48 3
    public function saveParentPageView(DynamicPageView &$pageView)
49
    {
50 3
        $this->parentPageViews[] = &$pageView;
51 3
    }
52
}
53