Code Duplication    Length = 14-14 lines in 2 locations

src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php 2 locations

@@ 463-476 (lines=14) @@
460
                    }
461
462
                    if ($array_atomic_type instanceof TNonEmptyArray) {
463
                        if (!$context->inside_loop && $array_atomic_type->count !== null) {
464
                            if ($array_atomic_type->count === 0) {
465
                                $array_atomic_type = new TArray(
466
                                    [
467
                                        new Type\Union([new TEmpty]),
468
                                        new Type\Union([new TEmpty]),
469
                                    ]
470
                                );
471
                            } else {
472
                                $array_atomic_type->count--;
473
                            }
474
                        } else {
475
                            $array_atomic_type = new TArray($array_atomic_type->type_params);
476
                        }
477
478
                        $array_type->addType($array_atomic_type);
479
                        $context->removeDescendents($var_id, $array_type);
@@ 481-494 (lines=14) @@
478
                        $array_type->addType($array_atomic_type);
479
                        $context->removeDescendents($var_id, $array_type);
480
                    } elseif ($array_atomic_type instanceof TNonEmptyList) {
481
                        if (!$context->inside_loop && $array_atomic_type->count !== null) {
482
                            if ($array_atomic_type->count === 0) {
483
                                $array_atomic_type = new TArray(
484
                                    [
485
                                        new Type\Union([new TEmpty]),
486
                                        new Type\Union([new TEmpty]),
487
                                    ]
488
                                );
489
                            } else {
490
                                $array_atomic_type->count--;
491
                            }
492
                        } else {
493
                            $array_atomic_type = new TList($array_atomic_type->type_param);
494
                        }
495
496
                        $array_type->addType($array_atomic_type);
497
                        $context->removeDescendents($var_id, $array_type);