public function guessDateFormat(string $date) : ? string
    {
        foreach ($this->dateFormats as $format) {
            $test = \DateTime::createFromFormat($format, $date);
            if ($test instanceof \DateTime) {
                $this->lastGuessedFormat = $format;

                return $format;
            }
        }

        return null;
    }
public function guessDateFormat(string $date) : ? string
    {
        foreach ($this->dateFormats as $format) {
            $test = \DateTime::createFromFormat($format, $date);
            if ($test instanceof \DateTime) {
                $this->lastGuessedFormat = $format;

                return $format;
            }
        }

        return null;
    }
public function guessDateFormat ( string $ date ) : ? string { foreach ( $ this -> dateFormats as $ format ) { $ test = \ DateTime :: createFromFormat ( $ format , $ date ) ; if ( $ test instanceof \ DateTime ) { $ this -> lastGuessedFormat = $ format ; return $ format ; } } return null ; }
Tries to guess the date's format from the list
@param  string                   $date
@return string|null             date Format
Tries to guess the date s format from the list