| @@ 2593-2602 (lines=10) @@ | ||
| 2590 | * |
|
| 2591 | * @return static <p>(Immutable)</p> |
|
| 2592 | */ |
|
| 2593 | public function mergeAppendKeepIndex(array $array = [], bool $recursive = false) |
|
| 2594 | { |
|
| 2595 | if (true === $recursive) { |
|
| 2596 | $result = \array_replace_recursive($this->array, $array); |
|
| 2597 | } else { |
|
| 2598 | $result = \array_replace($this->array, $array); |
|
| 2599 | } |
|
| 2600 | ||
| 2601 | return static::create($result); |
|
| 2602 | } |
|
| 2603 | ||
| 2604 | /** |
|
| 2605 | * Merge the new $array into the current array. |
|
| @@ 2615-2624 (lines=10) @@ | ||
| 2612 | * |
|
| 2613 | * @return static <p>(Immutable)</p> |
|
| 2614 | */ |
|
| 2615 | public function mergeAppendNewIndex(array $array = [], bool $recursive = false) |
|
| 2616 | { |
|
| 2617 | if (true === $recursive) { |
|
| 2618 | $result = \array_merge_recursive($this->array, $array); |
|
| 2619 | } else { |
|
| 2620 | $result = \array_merge($this->array, $array); |
|
| 2621 | } |
|
| 2622 | ||
| 2623 | return static::create($result); |
|
| 2624 | } |
|
| 2625 | ||
| 2626 | /** |
|
| 2627 | * Merge the the current array into the $array. |
|
| @@ 2636-2645 (lines=10) @@ | ||
| 2633 | * |
|
| 2634 | * @return static <p>(Immutable)</p> |
|
| 2635 | */ |
|
| 2636 | public function mergePrependKeepIndex(array $array = [], bool $recursive = false) |
|
| 2637 | { |
|
| 2638 | if (true === $recursive) { |
|
| 2639 | $result = \array_replace_recursive($array, $this->array); |
|
| 2640 | } else { |
|
| 2641 | $result = \array_replace($array, $this->array); |
|
| 2642 | } |
|
| 2643 | ||
| 2644 | return static::create($result); |
|
| 2645 | } |
|
| 2646 | ||
| 2647 | /** |
|
| 2648 | * Merge the current array into the new $array. |
|
| @@ 2658-2667 (lines=10) @@ | ||
| 2655 | * |
|
| 2656 | * @return static <p>(Immutable)</p> |
|
| 2657 | */ |
|
| 2658 | public function mergePrependNewIndex(array $array = [], bool $recursive = false) |
|
| 2659 | { |
|
| 2660 | if (true === $recursive) { |
|
| 2661 | $result = \array_merge_recursive($array, $this->array); |
|
| 2662 | } else { |
|
| 2663 | $result = \array_merge($array, $this->array); |
|
| 2664 | } |
|
| 2665 | ||
| 2666 | return static::create($result); |
|
| 2667 | } |
|
| 2668 | ||
| 2669 | /** |
|
| 2670 | * @return ArrayyMeta|static |
|