1 | <?php |
||
14 | class ArrayContainer implements ContainerInterface, \ArrayAccess |
||
15 | { |
||
16 | /** |
||
17 | * @var array|\ArrayAccess The container data |
||
18 | */ |
||
19 | protected $data; |
||
20 | |||
21 | /** |
||
22 | * @var ContainerInterface The container that will be used for dependency lookups |
||
23 | */ |
||
24 | protected $delegateLookupContainer; |
||
25 | |||
26 | /** |
||
27 | * @param array|\ArrayAccess|\Traversable $data Data for the container |
||
28 | * @param ContainerInterface $delegateLookupContainer The container that will be used for dependency lookups. |
||
29 | * |
||
30 | * @throws \InvalidArgumentException if the provided data is not an array or array-like object |
||
31 | */ |
||
32 | 7 | public function __construct($data = array(), $delegateLookupContainer = null) |
|
43 | |||
44 | 6 | public function get($id) |
|
59 | |||
60 | 2 | public function has($identifier) |
|
64 | |||
65 | 1 | public function offsetExists($offset) |
|
69 | |||
70 | 2 | public function offsetGet($offset) |
|
74 | |||
75 | 3 | public function offsetSet($offset, $value) |
|
76 | 1 | { |
|
77 | 3 | $this->data[$offset] = $value; |
|
78 | 3 | } |
|
79 | |||
80 | 1 | public function offsetUnset($offset) |
|
84 | } |
||
85 |