protected function getClasses($type, array $attributes = [], $errors = null)
    {
        $classes = $this->getDefaultClasses($type);

        if (isset($attributes['class'])) {
            $classes .= ' '.$attributes['class'];
        }

        if ( ! empty($errors)) {
            $classes .= ' '.(isset($this->cssClasses['error']) ? $this->cssClasses['error'] : 'error');
        }

        return trim($classes);
    }