protected function convertToDateTime($date)
    {
        if ($date instanceof \DateTime) {
            return $date;
        }

        if (is_string($date)) {
            return new \DateTime($date);
        }

        throw new TransformationFailure('YAML Front Matter dates must be quoted.');
    }