1 | <?php |
||
20 | class Container implements ContainerInterface, Serializable |
||
21 | { |
||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $params = []; |
||
26 | |||
27 | /** |
||
28 | * @param array $params |
||
29 | */ |
||
30 | 147 | public function __construct(array $params = []) |
|
36 | |||
37 | /** |
||
38 | * @param string $key |
||
39 | * @param mixed $value |
||
40 | * |
||
41 | * @return Container |
||
42 | */ |
||
43 | 6 | public function add($key, $value) |
|
51 | |||
52 | /** |
||
53 | * @param callable $fn |
||
54 | */ |
||
55 | 3 | public function forAll(callable $fn) |
|
61 | |||
62 | /** |
||
63 | * @param string $key |
||
64 | * |
||
65 | * @return mixed|null |
||
66 | */ |
||
67 | 58 | public function get($key) |
|
71 | |||
72 | /** |
||
73 | * @return array |
||
74 | */ |
||
75 | 72 | public function getAll() |
|
79 | |||
80 | /** |
||
81 | * @return ArrayIterator |
||
82 | */ |
||
83 | 4 | public function getIterator() |
|
87 | |||
88 | /** |
||
89 | * @param string $key |
||
90 | * |
||
91 | * @return bool |
||
92 | */ |
||
93 | 103 | public function has($key) |
|
97 | |||
98 | /** |
||
99 | * @param string $key |
||
100 | * |
||
101 | * @return $this |
||
102 | */ |
||
103 | 23 | public function remove($key) |
|
111 | |||
112 | /** |
||
113 | * @param string $key |
||
114 | * @param mixed $value |
||
115 | * |
||
116 | * @return $this |
||
117 | */ |
||
118 | 129 | public function set($key, $value) |
|
124 | |||
125 | /** |
||
126 | * {@inheritdoc} |
||
127 | * |
||
128 | * @return string the string representation of the object or null |
||
129 | */ |
||
130 | 3 | public function serialize() |
|
134 | |||
135 | /** |
||
136 | * {@inheritdoc} |
||
137 | * |
||
138 | * @param string $data The string representation of the object. |
||
139 | * |
||
140 | * @return void |
||
141 | */ |
||
142 | 3 | public function unserialize($data) |
|
146 | |||
147 | /** |
||
148 | * {@inheritdoc} |
||
149 | * |
||
150 | * @param mixed $offset An offset to check for. |
||
151 | * |
||
152 | * @return bool true on success or false on failure. |
||
153 | * The return value will be casted to boolean if non-boolean was returned. |
||
154 | */ |
||
155 | 25 | public function offsetExists($offset) |
|
159 | |||
160 | /** |
||
161 | * {@inheritdoc} |
||
162 | * |
||
163 | * @param mixed $offset The offset to retrieve. |
||
164 | * |
||
165 | * @return mixed Can return all value types. |
||
166 | */ |
||
167 | 15 | public function offsetGet($offset) |
|
171 | |||
172 | /** |
||
173 | * {@inheritdoc} |
||
174 | * |
||
175 | * @param mixed $offset The offset to assign the value to. |
||
176 | * @param mixed $value The value to set. |
||
177 | * |
||
178 | * @return void |
||
179 | */ |
||
180 | 12 | public function offsetSet($offset, $value) |
|
184 | |||
185 | /** |
||
186 | * {@inheritdoc} |
||
187 | * |
||
188 | * @param mixed $offset The offset to unset. |
||
189 | * |
||
190 | * @return void |
||
191 | */ |
||
192 | 17 | public function offsetUnset($offset) |
|
196 | |||
197 | /** |
||
198 | * @param mixed $item |
||
199 | * |
||
200 | * @return mixed |
||
201 | */ |
||
202 | 38 | protected function recursiveClone($item) |
|
211 | |||
212 | /** |
||
213 | * Clone all child objects (in the array tree) |
||
214 | */ |
||
215 | 20 | public function __clone() |
|
219 | } |
||
220 |