@@ 163-170 (lines=8) @@ | ||
160 | * |
|
161 | * @return ArrayImitator A new array with the keys/values from $array added |
|
162 | */ |
|
163 | public function merge(array $array, $recursively = false) |
|
164 | { |
|
165 | if (true === $recursively) { |
|
166 | return new static(array_merge_recursive($this->elements, $array)); |
|
167 | } |
|
168 | ||
169 | return new static(array_merge($this->elements, $array)); |
|
170 | } |
|
171 | ||
172 | /** |
|
173 | * Pad the current array to the specified size with a given value. |
|
@@ 204-211 (lines=8) @@ | ||
201 | * |
|
202 | * @return ArrayImitator A new array with the same keys but new values |
|
203 | */ |
|
204 | public function replace(array $array, $recursively = false) |
|
205 | { |
|
206 | if (true === $recursively) { |
|
207 | return new static(array_replace_recursive($this->elements, $array)); |
|
208 | } |
|
209 | ||
210 | return new static(array_replace($this->elements, $array)); |
|
211 | } |
|
212 | ||
213 | /** |
|
214 | * Reverse the values order of the current array. |