| @@ 2359-2368 (lines=10) @@ | ||
| 2356 | * |
|
| 2357 | * @return static <p>(Immutable)</p> |
|
| 2358 | */ |
|
| 2359 | public function mergeAppendKeepIndex(array $array = [], bool $recursive = false) |
|
| 2360 | { |
|
| 2361 | if (true === $recursive) { |
|
| 2362 | $result = \array_replace_recursive($this->array, $array); |
|
| 2363 | } else { |
|
| 2364 | $result = \array_replace($this->array, $array); |
|
| 2365 | } |
|
| 2366 | ||
| 2367 | return static::create($result); |
|
| 2368 | } |
|
| 2369 | ||
| 2370 | /** |
|
| 2371 | * Merge the new $array into the current array. |
|
| @@ 2381-2390 (lines=10) @@ | ||
| 2378 | * |
|
| 2379 | * @return static <p>(Immutable)</p> |
|
| 2380 | */ |
|
| 2381 | public function mergeAppendNewIndex(array $array = [], bool $recursive = false) |
|
| 2382 | { |
|
| 2383 | if (true === $recursive) { |
|
| 2384 | $result = \array_merge_recursive($this->array, $array); |
|
| 2385 | } else { |
|
| 2386 | $result = \array_merge($this->array, $array); |
|
| 2387 | } |
|
| 2388 | ||
| 2389 | return static::create($result); |
|
| 2390 | } |
|
| 2391 | ||
| 2392 | /** |
|
| 2393 | * Merge the the current array into the $array. |
|
| @@ 2402-2411 (lines=10) @@ | ||
| 2399 | * |
|
| 2400 | * @return static <p>(Immutable)</p> |
|
| 2401 | */ |
|
| 2402 | public function mergePrependKeepIndex(array $array = [], bool $recursive = false) |
|
| 2403 | { |
|
| 2404 | if (true === $recursive) { |
|
| 2405 | $result = \array_replace_recursive($array, $this->array); |
|
| 2406 | } else { |
|
| 2407 | $result = \array_replace($array, $this->array); |
|
| 2408 | } |
|
| 2409 | ||
| 2410 | return static::create($result); |
|
| 2411 | } |
|
| 2412 | ||
| 2413 | /** |
|
| 2414 | * Merge the current array into the new $array. |
|
| @@ 2424-2433 (lines=10) @@ | ||
| 2421 | * |
|
| 2422 | * @return static <p>(Immutable)</p> |
|
| 2423 | */ |
|
| 2424 | public function mergePrependNewIndex(array $array = [], bool $recursive = false) |
|
| 2425 | { |
|
| 2426 | if (true === $recursive) { |
|
| 2427 | $result = \array_merge_recursive($array, $this->array); |
|
| 2428 | } else { |
|
| 2429 | $result = \array_merge($array, $this->array); |
|
| 2430 | } |
|
| 2431 | ||
| 2432 | return static::create($result); |
|
| 2433 | } |
|
| 2434 | ||
| 2435 | /** |
|
| 2436 | * Get the min value from an array. |
|