ItemInjectableTrait::getDataItem()   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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace RedRat\Presenthor\Item;
6
7
/**
8
 * ItemInjectable Trait
9
 *
10
 * @package RedRat\Presenthor\Item
11
 */
12
trait ItemInjectableTrait
13
{
14
    /**
15
     * @var DataItemInterface
16
     */
17
    protected $dataItem;
18
19
    /**
20
     * ItemInjectable Trait constructor
21
     *
22
     * @param DataItemInterface $dataItem
23
     */
24 3
    public function __construct(DataItemInterface $dataItem)
25
    {
26 3
        $this->dataItem = $dataItem;
27 3
    }
28
29
    /**
30
     * @return DataItemInterface
31
     */
32 1
    public function getDataItem(): DataItemInterface
33
    {
34 1
        return $this->dataItem;
35
    }
36
37
    /**
38
     * @param DataItemInterface $dataItem
39
     * @return void
40
     */
41 1
    public function setDataItem(DataItemInterface $dataItem): void
42
    {
43 1
        $this->dataItem = $dataItem;
44 1
    }
45
}
46