protected function isDate($key) : bool
    {
        $value = $this->param[$key];
        if (isset($value) && $value instanceof \DateTime) {
            return true;
        }

        $date = date_parse($value);

        if ((!is_string($value) && !is_numeric($value)) || strtotime($value) === false) {
            $this->errors[$key.self::ERROR] = $this->convertToFieldName($key).' must be a valid date.';
            return false;
        } elseif (checkdate($date['month'], $date['day'], $date['year'])) {
            return true;
        }


        $this->errors[$key.self::ERROR] = $this->convertToFieldName($key).' must be a valid date.';
        return false;
    }