Total Complexity | 10 |
Total Lines | 84 |
Duplicated Lines | 0 % |
Coverage | 95.45% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
9 | class DefinitionsCollection |
||
10 | { |
||
11 | protected $items = []; |
||
12 | |||
13 | /** |
||
14 | * DefinitionsCollection constructor. |
||
15 | * @param array $items |
||
16 | */ |
||
17 | 4 | public function __construct(array $items) |
|
18 | { |
||
19 | 4 | $this->items = $items; |
|
20 | 4 | } |
|
21 | |||
22 | /** |
||
23 | * @return array |
||
24 | */ |
||
25 | 5 | public function all() |
|
26 | { |
||
27 | 5 | return $this->items; |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * @param $items |
||
32 | * @return array |
||
33 | */ |
||
34 | 3 | public function replace($items) |
|
35 | { |
||
36 | 3 | return $this->items = $items + $this->items; |
|
37 | } |
||
38 | |||
39 | /** |
||
40 | * @param $offset |
||
41 | * @return bool |
||
42 | */ |
||
43 | 3 | public function has($offset) |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param $offset |
||
50 | * @return mixed |
||
51 | */ |
||
52 | 3 | public function get($offset) |
|
53 | { |
||
54 | 3 | return $this->offsetGet($offset); |
|
55 | } |
||
56 | |||
57 | /** |
||
58 | * @param $offset |
||
59 | * @param $value |
||
60 | * @return mixed |
||
61 | */ |
||
62 | 3 | public function set($offset, $value) |
|
63 | { |
||
64 | 3 | $this->offsetSet($offset, $value); |
|
65 | 3 | } |
|
66 | |||
67 | /** |
||
68 | * @inheritdoc |
||
69 | */ |
||
70 | 3 | public function offsetExists($offset) |
|
71 | { |
||
72 | 3 | return isset($this->items[$offset]); |
|
73 | } |
||
74 | |||
75 | /** |
||
76 | * @inheritdoc |
||
77 | */ |
||
78 | 3 | public function offsetGet($offset) |
|
81 | } |
||
82 | |||
83 | /** |
||
84 | * @inheritdoc |
||
85 | * @param string $value |
||
86 | */ |
||
87 | 3 | public function offsetSet($offset, $value) |
|
93 | } |
||
94 | 3 | } |
|
95 | } |
||
96 |