Code Duplication    Length = 8-8 lines in 2 locations

src/PhpSpreadsheet/Calculation/DateTime.php 2 locations

@@ 580-587 (lines=8) @@
577
                    $PHPDateArray['second']
578
                )
579
            );
580
            switch (Functions::getReturnDateType()) {
581
                case Functions::RETURNDATE_EXCEL:
582
                    return (float) $excelDateValue;
583
                case Functions::RETURNDATE_PHP_NUMERIC:
584
                    return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue);
585
                case Functions::RETURNDATE_PHP_OBJECT:
586
                    return new \DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00');
587
            }
588
        }
589
        return Functions::VALUE();
590
    }
@@ 641-648 (lines=8) @@
638
                $excelDateValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1;
639
            }
640
641
            switch (Functions::getReturnDateType()) {
642
                case Functions::RETURNDATE_EXCEL:
643
                    return (float) $excelDateValue;
644
                case Functions::RETURNDATE_PHP_NUMERIC:
645
                    return (integer) $phpDateValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue+25569) - 3600;
646
                case Functions::RETURNDATE_PHP_OBJECT:
647
                    return new \DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']);
648
            }
649
        }
650
        return Functions::VALUE();
651
    }