Code Duplication    Length = 10-10 lines in 4 locations

src/Arrayy.php 4 locations

@@ 2367-2376 (lines=10) @@
2364
     * @return static
2365
     *                <p>(Immutable)</p>
2366
     */
2367
    public function mergeAppendKeepIndex(array $array = [], bool $recursive = false): self
2368
    {
2369
        if ($recursive === true) {
2370
            $result = \array_replace_recursive($this->array, $array);
2371
        } else {
2372
            $result = \array_replace($this->array, $array);
2373
        }
2374
2375
        return static::create($result, $this->iteratorClass, false);
2376
    }
2377
2378
    /**
2379
     * Merge the new $array into the current array.
@@ 2390-2399 (lines=10) @@
2387
     * @return static
2388
     *                <p>(Immutable)</p>
2389
     */
2390
    public function mergeAppendNewIndex(array $array = [], bool $recursive = false): self
2391
    {
2392
        if ($recursive === true) {
2393
            $result = \array_merge_recursive($this->array, $array);
2394
        } else {
2395
            $result = \array_merge($this->array, $array);
2396
        }
2397
2398
        return static::create($result, $this->iteratorClass, false);
2399
    }
2400
2401
    /**
2402
     * Merge the the current array into the $array.
@@ 2412-2421 (lines=10) @@
2409
     * @return static
2410
     *                <p>(Immutable)</p>
2411
     */
2412
    public function mergePrependKeepIndex(array $array = [], bool $recursive = false): self
2413
    {
2414
        if ($recursive === true) {
2415
            $result = \array_replace_recursive($array, $this->array);
2416
        } else {
2417
            $result = \array_replace($array, $this->array);
2418
        }
2419
2420
        return static::create($result, $this->iteratorClass, false);
2421
    }
2422
2423
    /**
2424
     * Merge the current array into the new $array.
@@ 2435-2444 (lines=10) @@
2432
     * @return static
2433
     *                <p>(Immutable)</p>
2434
     */
2435
    public function mergePrependNewIndex(array $array = [], bool $recursive = false): self
2436
    {
2437
        if ($recursive === true) {
2438
            $result = \array_merge_recursive($array, $this->array);
2439
        } else {
2440
            $result = \array_merge($array, $this->array);
2441
        }
2442
2443
        return static::create($result, $this->iteratorClass, false);
2444
    }
2445
2446
    /**
2447
     * @return ArrayyMeta|static