Total Complexity | 8 |
Total Lines | 80 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | trait HasData |
||
11 | { |
||
12 | |||
13 | /** |
||
14 | * The "data" member |
||
15 | * |
||
16 | * @var ResourceIdentifierFactory|ResourceObjectFactory|CollectionFactory|null |
||
17 | */ |
||
18 | public $data; |
||
19 | |||
20 | /** |
||
21 | * Flag to indicate that "data" member has been set. |
||
22 | * This can distinguish "data" member set to null to unset "data" member. |
||
23 | * |
||
24 | * @var boolean |
||
25 | */ |
||
26 | private $hasBeenSet = false; |
||
27 | |||
28 | /** |
||
29 | * Set "data" member |
||
30 | * |
||
31 | * @param ResourceIdentifierFactory|ResourceObjectFactory|CollectionFactory|null $data |
||
32 | * @return static |
||
33 | */ |
||
34 | 15 | public function setData($data) |
|
35 | { |
||
36 | 15 | $this->data = $data; |
|
37 | 15 | $this->hasBeenSet = true; |
|
38 | |||
39 | 15 | return $this; |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * Check if the "data" member has been set. |
||
44 | * |
||
45 | * @return boolean |
||
46 | */ |
||
47 | 3 | public function dataHasBeenSet(): bool |
|
50 | } |
||
51 | |||
52 | /** |
||
53 | * Undocumented function |
||
54 | * |
||
55 | * @param integer $options Bitmask |
||
56 | * @param integer $count In case of collection, it represents the number of resource object |
||
57 | * or resource identifier to generate |
||
58 | * |
||
59 | * @return static |
||
60 | */ |
||
61 | 9 | public function fakeData($options = null, $count = null) |
|
92 |