@@ 2545-2554 (lines=10) @@ | ||
2542 | * |
|
2543 | * @return static <p>(Immutable)</p> |
|
2544 | */ |
|
2545 | public function mergeAppendKeepIndex(array $array = [], bool $recursive = false) |
|
2546 | { |
|
2547 | if (true === $recursive) { |
|
2548 | $result = \array_replace_recursive($this->array, $array); |
|
2549 | } else { |
|
2550 | $result = \array_replace($this->array, $array); |
|
2551 | } |
|
2552 | ||
2553 | return static::create($result); |
|
2554 | } |
|
2555 | ||
2556 | /** |
|
2557 | * Merge the new $array into the current array. |
|
@@ 2567-2576 (lines=10) @@ | ||
2564 | * |
|
2565 | * @return static <p>(Immutable)</p> |
|
2566 | */ |
|
2567 | public function mergeAppendNewIndex(array $array = [], bool $recursive = false) |
|
2568 | { |
|
2569 | if (true === $recursive) { |
|
2570 | $result = \array_merge_recursive($this->array, $array); |
|
2571 | } else { |
|
2572 | $result = \array_merge($this->array, $array); |
|
2573 | } |
|
2574 | ||
2575 | return static::create($result); |
|
2576 | } |
|
2577 | ||
2578 | /** |
|
2579 | * Merge the the current array into the $array. |
|
@@ 2588-2597 (lines=10) @@ | ||
2585 | * |
|
2586 | * @return static <p>(Immutable)</p> |
|
2587 | */ |
|
2588 | public function mergePrependKeepIndex(array $array = [], bool $recursive = false) |
|
2589 | { |
|
2590 | if (true === $recursive) { |
|
2591 | $result = \array_replace_recursive($array, $this->array); |
|
2592 | } else { |
|
2593 | $result = \array_replace($array, $this->array); |
|
2594 | } |
|
2595 | ||
2596 | return static::create($result); |
|
2597 | } |
|
2598 | ||
2599 | /** |
|
2600 | * Merge the current array into the new $array. |
|
@@ 2610-2619 (lines=10) @@ | ||
2607 | * |
|
2608 | * @return static <p>(Immutable)</p> |
|
2609 | */ |
|
2610 | public function mergePrependNewIndex(array $array = [], bool $recursive = false) |
|
2611 | { |
|
2612 | if (true === $recursive) { |
|
2613 | $result = \array_merge_recursive($array, $this->array); |
|
2614 | } else { |
|
2615 | $result = \array_merge($array, $this->array); |
|
2616 | } |
|
2617 | ||
2618 | return static::create($result); |
|
2619 | } |
|
2620 | ||
2621 | /** |
|
2622 | * @return ArrayyMeta|static |