Code Duplication    Length = 10-10 lines in 4 locations

src/Arrayy.php 4 locations

@@ 2637-2646 (lines=10) @@
2634
   *
2635
   * @return static <p>(Immutable)</p>
2636
   */
2637
  public function mergeAppendKeepIndex(array $array = [], bool $recursive = false)
2638
  {
2639
    if (true === $recursive) {
2640
      $result = \array_replace_recursive($this->array, $array);
2641
    } else {
2642
      $result = \array_replace($this->array, $array);
2643
    }
2644
2645
    return static::create($result, $this->iteratorClass, false);
2646
  }
2647
2648
  /**
2649
   * Merge the new $array into the current array.
@@ 2659-2668 (lines=10) @@
2656
   *
2657
   * @return static <p>(Immutable)</p>
2658
   */
2659
  public function mergeAppendNewIndex(array $array = [], bool $recursive = false)
2660
  {
2661
    if (true === $recursive) {
2662
      $result = \array_merge_recursive($this->array, $array);
2663
    } else {
2664
      $result = \array_merge($this->array, $array);
2665
    }
2666
2667
    return static::create($result, $this->iteratorClass, false);
2668
  }
2669
2670
  /**
2671
   * Merge the the current array into the $array.
@@ 2680-2689 (lines=10) @@
2677
   *
2678
   * @return static <p>(Immutable)</p>
2679
   */
2680
  public function mergePrependKeepIndex(array $array = [], bool $recursive = false)
2681
  {
2682
    if (true === $recursive) {
2683
      $result = \array_replace_recursive($array, $this->array);
2684
    } else {
2685
      $result = \array_replace($array, $this->array);
2686
    }
2687
2688
    return static::create($result, $this->iteratorClass, false);
2689
  }
2690
2691
  /**
2692
   * Merge the current array into the new $array.
@@ 2702-2711 (lines=10) @@
2699
   *
2700
   * @return static <p>(Immutable)</p>
2701
   */
2702
  public function mergePrependNewIndex(array $array = [], bool $recursive = false)
2703
  {
2704
    if (true === $recursive) {
2705
      $result = \array_merge_recursive($array, $this->array);
2706
    } else {
2707
      $result = \array_merge($array, $this->array);
2708
    }
2709
2710
    return static::create($result, $this->iteratorClass, false);
2711
  }
2712
2713
  /**
2714
   * @return ArrayyMeta|static