Code Duplication    Length = 7-8 lines in 2 locations

src/PhpSpreadsheet/Shared/Date.php 1 location

@@ 438-444 (lines=7) @@
435
            return false;
436
        }
437
438
        if (strpos($dateValue, ':') !== false) {
439
            $timeValue = \PhpOffice\PhpSpreadsheet\Calculation\DateTime::TIMEVALUE($dateValue);
440
            if ($timeValue === \PhpOffice\PhpSpreadsheet\Calculation\Functions::VALUE()) {
441
                return false;
442
            }
443
            $dateValueNew += $timeValue;
444
        }
445
446
        return $dateValueNew;
447
    }

src/PhpSpreadsheet/Calculation/TextData.php 1 location

@@ 597-604 (lines=8) @@
594
            $dateSetting = Functions::getReturnDateType();
595
            Functions::setReturnDateType(Functions::RETURNDATE_EXCEL);
596
597
            if (strpos($value, ':') !== false) {
598
                $timeValue = DateTime::TIMEVALUE($value);
599
                if ($timeValue !== Functions::VALUE()) {
600
                    Functions::setReturnDateType($dateSetting);
601
602
                    return $timeValue;
603
                }
604
            }
605
            $dateValue = DateTime::DATEVALUE($value);
606
            if ($dateValue !== Functions::VALUE()) {
607
                Functions::setReturnDateType($dateSetting);