|
@@ 172-179 (lines=8) @@
|
| 169 |
|
* |
| 170 |
|
* @return ArrayImitator A new array with the keys/values from $array added |
| 171 |
|
*/ |
| 172 |
|
public function merge(array $array, $recursively = false) |
| 173 |
|
{ |
| 174 |
|
if (true === $recursively) { |
| 175 |
|
return new static(array_merge_recursive($this->elements, $array)); |
| 176 |
|
} |
| 177 |
|
|
| 178 |
|
return new static(array_merge($this->elements, $array)); |
| 179 |
|
} |
| 180 |
|
|
| 181 |
|
/** |
| 182 |
|
* Pad the current array to the specified size with a given value. |
|
@@ 213-220 (lines=8) @@
|
| 210 |
|
* |
| 211 |
|
* @return ArrayImitator A new array with the same keys but new values |
| 212 |
|
*/ |
| 213 |
|
public function replace(array $array, $recursively = false) |
| 214 |
|
{ |
| 215 |
|
if (true === $recursively) { |
| 216 |
|
return new static(array_replace_recursive($this->elements, $array)); |
| 217 |
|
} |
| 218 |
|
|
| 219 |
|
return new static(array_replace($this->elements, $array)); |
| 220 |
|
} |
| 221 |
|
|
| 222 |
|
/** |
| 223 |
|
* Reverse the values order of the current array. |