protected function getMessage($key, $ruleName, array $keyRules, array $keyTitles, array $customMessages = [])
    {

        if (in_array($ruleName, $this->sizeRules)) {
            return $this->getSizeMessage($key, $ruleName, $keyRules, $keyTitles, $customMessages);
        }

        if ($customMessage = $this->getCustomMessage($key, $ruleName, $customMessages)) {
            return $customMessage;
        }

        $replacements = $this->replacements($ruleName, $keyRules);

        $replacements['attribute'] = isset($keyTitles[$key]) ? $keyTitles[$key] : $key;

        return $this->textProvider->get($ruleName, $replacements);

    }