Captioning\Format\SubripFile::cleanUpTimecode PHP Method

cleanUpTimecode() private method

Add milliseconds and leading zeroes if they are missing
private cleanUpTimecode ( $timecode ) : mixed
$timecode
return mixed
    private function cleanUpTimecode($timecode)
    {
        strpos($timecode, ',') ?: ($timecode .= ',000');
        $patternNoLeadingZeroes = '/(?:(?<=\\:)|^)\\d(?=(:|,))/';
        return preg_replace_callback($patternNoLeadingZeroes, function ($matches) {
            return sprintf('%02d', $matches[0]);
        }, $timecode);
    }