ItemInjectableTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 32
ccs 7
cts 7
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDataItem() 0 3 1
A __construct() 0 3 1
A setDataItem() 0 3 1
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