Code Duplication    Length = 10-10 lines in 4 locations

src/Arrayy.php 4 locations

@@ 2439-2448 (lines=10) @@
2436
     * @return static
2437
     *                <p>(Immutable)</p>
2438
     */
2439
    public function mergeAppendKeepIndex(array $array = [], bool $recursive = false): self
2440
    {
2441
        if ($recursive === true) {
2442
            $result = \array_replace_recursive($this->getArray(), $array);
2443
        } else {
2444
            $result = \array_replace($this->getArray(), $array);
2445
        }
2446
2447
        return static::create($result, $this->iteratorClass, false);
2448
    }
2449
2450
    /**
2451
     * Merge the new $array into the current array.
@@ 2462-2471 (lines=10) @@
2459
     * @return static
2460
     *                <p>(Immutable)</p>
2461
     */
2462
    public function mergeAppendNewIndex(array $array = [], bool $recursive = false): self
2463
    {
2464
        if ($recursive === true) {
2465
            $result = \array_merge_recursive($this->getArray(), $array);
2466
        } else {
2467
            $result = \array_merge($this->getArray(), $array);
2468
        }
2469
2470
        return static::create($result, $this->iteratorClass, false);
2471
    }
2472
2473
    /**
2474
     * Merge the the current array into the $array.
@@ 2484-2493 (lines=10) @@
2481
     * @return static
2482
     *                <p>(Immutable)</p>
2483
     */
2484
    public function mergePrependKeepIndex(array $array = [], bool $recursive = false): self
2485
    {
2486
        if ($recursive === true) {
2487
            $result = \array_replace_recursive($array, $this->getArray());
2488
        } else {
2489
            $result = \array_replace($array, $this->getArray());
2490
        }
2491
2492
        return static::create($result, $this->iteratorClass, false);
2493
    }
2494
2495
    /**
2496
     * Merge the current array into the new $array.
@@ 2507-2516 (lines=10) @@
2504
     * @return static
2505
     *                <p>(Immutable)</p>
2506
     */
2507
    public function mergePrependNewIndex(array $array = [], bool $recursive = false): self
2508
    {
2509
        if ($recursive === true) {
2510
            $result = \array_merge_recursive($array, $this->getArray());
2511
        } else {
2512
            $result = \array_merge($array, $this->getArray());
2513
        }
2514
2515
        return static::create($result, $this->iteratorClass, false);
2516
    }
2517
2518
    /**
2519
     * @return ArrayyMeta|static