Potsky\LaravelLocalizationHelpers\Factory\Localization::getBackupFileDate PHP Method

getBackupFileDate() private method

Return the date of a backup file
private getBackupFileDate ( string $file, string $ext = 'php' ) : DateTime | null
$file string a backup file path
$ext string
return DateTime | null
    private function getBackupFileDate($file, $ext = 'php')
    {
        $matches = array();
        if (preg_match('@^(.*)([0-9]{8}_[0-9]{6})\\.' . $ext . '$@', $file, $matches) === 1) {
            return \DateTime::createFromFormat(self::BACKUP_DATE_FORMAT, $matches[2]);
        } else {
            return null;
        }
        // @codeCoverageIgnoreEnd
    }