public function addError($key, $message, $params = null)
    {
        if (!is_string($message)) {
            $message = vsprintf(static::$messages[$message], is_array($params) ? $params : []);
        }
        $this->errors[$key] = $message;

        return $this;
    }