Code Duplication    Length = 8-8 lines in 2 locations

src/PhpSpreadsheet/Calculation/DateTime.php 2 locations

@@ 631-638 (lines=8) @@
628
                $excelDateValue = Date::formattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1;
629
            }
630
631
            switch (Functions::getReturnDateType()) {
632
                case Functions::RETURNDATE_EXCEL:
633
                    return (float) $excelDateValue;
634
                case Functions::RETURNDATE_PHP_NUMERIC:
635
                    return (int) $phpDateValue = Date::excelToTimestamp($excelDateValue + 25569) - 3600;
636
                case Functions::RETURNDATE_PHP_OBJECT:
637
                    return new \DateTime('1900-01-01 ' . $PHPDateArray['hour'] . ':' . $PHPDateArray['minute'] . ':' . $PHPDateArray['second']);
638
            }
639
        }
640
641
        return Functions::VALUE();
@@ 569-576 (lines=8) @@
566
                    $PHPDateArray['second']
567
                )
568
            );
569
            switch (Functions::getReturnDateType()) {
570
                case Functions::RETURNDATE_EXCEL:
571
                    return (float) $excelDateValue;
572
                case Functions::RETURNDATE_PHP_NUMERIC:
573
                    return (int) Date::excelToTimestamp($excelDateValue);
574
                case Functions::RETURNDATE_PHP_OBJECT:
575
                    return new \DateTime($PHPDateArray['year'] . '-' . $PHPDateArray['month'] . '-' . $PHPDateArray['day'] . ' 00:00:00');
576
            }
577
        }
578
579
        return Functions::VALUE();