| @@ 2479-2488 (lines=10) @@ | ||
| 2476 | * |
|
| 2477 | * @return static <p>(Immutable)</p> |
|
| 2478 | */ |
|
| 2479 | public function mergeAppendKeepIndex(array $array = [], bool $recursive = false) |
|
| 2480 | { |
|
| 2481 | if (true === $recursive) { |
|
| 2482 | $result = \array_replace_recursive($this->array, $array); |
|
| 2483 | } else { |
|
| 2484 | $result = \array_replace($this->array, $array); |
|
| 2485 | } |
|
| 2486 | ||
| 2487 | return static::create($result); |
|
| 2488 | } |
|
| 2489 | ||
| 2490 | /** |
|
| 2491 | * Merge the new $array into the current array. |
|
| @@ 2501-2510 (lines=10) @@ | ||
| 2498 | * |
|
| 2499 | * @return static <p>(Immutable)</p> |
|
| 2500 | */ |
|
| 2501 | public function mergeAppendNewIndex(array $array = [], bool $recursive = false) |
|
| 2502 | { |
|
| 2503 | if (true === $recursive) { |
|
| 2504 | $result = \array_merge_recursive($this->array, $array); |
|
| 2505 | } else { |
|
| 2506 | $result = \array_merge($this->array, $array); |
|
| 2507 | } |
|
| 2508 | ||
| 2509 | return static::create($result); |
|
| 2510 | } |
|
| 2511 | ||
| 2512 | /** |
|
| 2513 | * Merge the the current array into the $array. |
|
| @@ 2522-2531 (lines=10) @@ | ||
| 2519 | * |
|
| 2520 | * @return static <p>(Immutable)</p> |
|
| 2521 | */ |
|
| 2522 | public function mergePrependKeepIndex(array $array = [], bool $recursive = false) |
|
| 2523 | { |
|
| 2524 | if (true === $recursive) { |
|
| 2525 | $result = \array_replace_recursive($array, $this->array); |
|
| 2526 | } else { |
|
| 2527 | $result = \array_replace($array, $this->array); |
|
| 2528 | } |
|
| 2529 | ||
| 2530 | return static::create($result); |
|
| 2531 | } |
|
| 2532 | ||
| 2533 | /** |
|
| 2534 | * Merge the current array into the new $array. |
|
| @@ 2544-2553 (lines=10) @@ | ||
| 2541 | * |
|
| 2542 | * @return static <p>(Immutable)</p> |
|
| 2543 | */ |
|
| 2544 | public function mergePrependNewIndex(array $array = [], bool $recursive = false) |
|
| 2545 | { |
|
| 2546 | if (true === $recursive) { |
|
| 2547 | $result = \array_merge_recursive($array, $this->array); |
|
| 2548 | } else { |
|
| 2549 | $result = \array_merge($array, $this->array); |
|
| 2550 | } |
|
| 2551 | ||
| 2552 | return static::create($result); |
|
| 2553 | } |
|
| 2554 | ||
| 2555 | /** |
|
| 2556 | * Get the min value from an array. |
|