Code Duplication    Length = 10-10 lines in 4 locations

src/Arrayy.php 4 locations

@@ 3189-3198 (lines=10) @@
3186
     * @psalm-return static<TKey,T>
3187
     * @psalm-mutation-free
3188
     */
3189
    public function mergeAppendKeepIndex(array $array = [], bool $recursive = false): self
3190
    {
3191
        if ($recursive === true) {
3192
            $result = \array_replace_recursive($this->getArray(), $array);
3193
        } else {
3194
            $result = \array_replace($this->getArray(), $array);
3195
        }
3196
3197
        return static::create(
3198
            $result,
3199
            $this->iteratorClass,
3200
            false
3201
        );
@@ 3220-3229 (lines=10) @@
3217
     * @psalm-return static<TKey,T>
3218
     * @psalm-mutation-free
3219
     */
3220
    public function mergeAppendNewIndex(array $array = [], bool $recursive = false): self
3221
    {
3222
        if ($recursive === true) {
3223
            $result = \array_merge_recursive($this->getArray(), $array);
3224
        } else {
3225
            $result = \array_merge($this->getArray(), $array);
3226
        }
3227
3228
        return static::create(
3229
            $result,
3230
            $this->iteratorClass,
3231
            false
3232
        );
@@ 3250-3259 (lines=10) @@
3247
     * @psalm-return static<TKey,T>
3248
     * @psalm-mutation-free
3249
     */
3250
    public function mergePrependKeepIndex(array $array = [], bool $recursive = false): self
3251
    {
3252
        if ($recursive === true) {
3253
            $result = \array_replace_recursive($array, $this->getArray());
3254
        } else {
3255
            $result = \array_replace($array, $this->getArray());
3256
        }
3257
3258
        return static::create(
3259
            $result,
3260
            $this->iteratorClass,
3261
            false
3262
        );
@@ 3281-3290 (lines=10) @@
3278
     * @psalm-return static<TKey,T>
3279
     * @psalm-mutation-free
3280
     */
3281
    public function mergePrependNewIndex(array $array = [], bool $recursive = false): self
3282
    {
3283
        if ($recursive === true) {
3284
            $result = \array_merge_recursive($array, $this->getArray());
3285
        } else {
3286
            $result = \array_merge($array, $this->getArray());
3287
        }
3288
3289
        return static::create(
3290
            $result,
3291
            $this->iteratorClass,
3292
            false
3293
        );