Total Complexity | 6 |
Total Lines | 68 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
9 | trait ContainerArrayAccessTrait |
||
10 | { |
||
11 | /** |
||
12 | * Determine if a given offset exists. |
||
13 | * |
||
14 | * @param string $key |
||
15 | * @return bool |
||
16 | */ |
||
17 | public function offsetExists($key): bool |
||
18 | { |
||
19 | return $this->has($key); |
||
|
|||
20 | } |
||
21 | |||
22 | /** |
||
23 | * Get the value at a given offset. |
||
24 | * |
||
25 | * @param string $key |
||
26 | * @return mixed |
||
27 | */ |
||
28 | public function offsetGet($key): mixed |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Set the value at a given offset. |
||
35 | * |
||
36 | * @param string $key |
||
37 | * @param mixed $value |
||
38 | * @return void |
||
39 | */ |
||
40 | public function offsetSet($key, $value): void |
||
41 | { |
||
42 | $this->add($key, $value); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * Unset the value at a given offset. |
||
47 | * |
||
48 | * @param string $key |
||
49 | * @return void |
||
50 | */ |
||
51 | public function offsetUnset($key): void |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * Dynamically access container services. |
||
58 | * |
||
59 | * @param string $key |
||
60 | * @return mixed |
||
61 | */ |
||
62 | public function __get($key) |
||
63 | { |
||
64 | return $this[$key]; |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * Dynamically set container services. |
||
69 | * |
||
70 | * @param string $key |
||
71 | * @param mixed $value |
||
72 | * @return void |
||
73 | */ |
||
74 | public function __set($key, $value) |
||
77 | } |
||
78 | } |
||
79 |