Code Duplication    Length = 7-8 lines in 2 locations

src/PhpSpreadsheet/Shared/Date.php 1 location

@@ 455-461 (lines=7) @@
452
            return false;
453
        }
454
455
        if (strpos($dateValue, ':') !== false) {
456
            $timeValue = \PhpOffice\PhpSpreadsheet\Calculation\DateTime::TIMEVALUE($dateValue);
457
            if ($timeValue === \PhpOffice\PhpSpreadsheet\Calculation\Functions::VALUE()) {
458
                return false;
459
            }
460
            $dateValueNew += $timeValue;
461
        }
462
463
        return $dateValueNew;
464
    }

src/PhpSpreadsheet/Calculation/TextData.php 1 location

@@ 577-584 (lines=8) @@
574
            $dateSetting = Functions::getReturnDateType();
575
            Functions::setReturnDateType(Functions::RETURNDATE_EXCEL);
576
577
            if (strpos($value, ':') !== false) {
578
                $timeValue = DateTime::TIMEVALUE($value);
579
                if ($timeValue !== Functions::VALUE()) {
580
                    Functions::setReturnDateType($dateSetting);
581
582
                    return $timeValue;
583
                }
584
            }
585
            $dateValue = DateTime::DATEVALUE($value);
586
            if ($dateValue !== Functions::VALUE()) {
587
                Functions::setReturnDateType($dateSetting);