1 | <?php |
||
19 | class Repository implements RepositoryInterface |
||
20 | { |
||
21 | protected $repository = []; |
||
22 | |||
23 | /** |
||
24 | * Construct a configuration repository from an array |
||
25 | * |
||
26 | * @param array $values |
||
27 | */ |
||
28 | public function __construct(array $values = []) |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | public function get(string $key, $default = null) |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function set(string $key, $value) : void |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function del(string $key) : void |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function union(RepositoryInterface $repository) : RepositoryInterface |
||
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | public function intersection(RepositoryInterface $repository) : RepositoryInterface |
||
100 | |||
101 | /** |
||
102 | * {@inheritdoc}. |
||
103 | */ |
||
104 | public function getArray() : array |
||
108 | |||
109 | /** |
||
110 | * Set a new key (From ArrayAccess interface). |
||
111 | */ |
||
112 | public function offsetSet($offset, $value) |
||
120 | |||
121 | /** |
||
122 | * Check if a key exists (from ArrayAccess interface). |
||
123 | */ |
||
124 | public function offsetExists($offset) |
||
128 | |||
129 | /** |
||
130 | * Delete a key (from ArrayAccess interface). |
||
131 | */ |
||
132 | public function offsetUnset($offset) |
||
136 | |||
137 | /** |
||
138 | * Retrueve a key (from ArrayAccess interface). |
||
139 | */ |
||
140 | public function offsetGet($offset) |
||
144 | |||
145 | /** |
||
146 | * Count of element of a repository (from Countable interface). |
||
147 | */ |
||
148 | public function count() |
||
152 | |||
153 | /** |
||
154 | * Set the pointer to the first element (from Iterator interface). |
||
155 | */ |
||
156 | public function rewind() |
||
160 | |||
161 | /** |
||
162 | * Get the current element (from Iterator interface). |
||
163 | */ |
||
164 | public function current() |
||
168 | |||
169 | /** |
||
170 | * Get the current position (from Iterator interface). |
||
171 | */ |
||
172 | public function key() |
||
176 | |||
177 | /** |
||
178 | * Set the pointer to the next element (from Iterator interface). |
||
179 | */ |
||
180 | public function next() |
||
184 | |||
185 | /** |
||
186 | * Checks if the current position is valid (from Iterator interface). |
||
187 | */ |
||
188 | public function valid() |
||
192 | } |
||
193 |