private static function getClass(FormTag $tag, $validation_error)
    {
        $class = wpcf7_form_controls_class($tag->getType(), 'wpcf7-text');

        if (in_array($tag->getBaseType(), ['email', 'url', 'tel'])) {
            $class .= ' wpcf7-validates-as-'.$tag->getBaseType();
        }

        if ($validation_error) {
            $class .= ' wpcf7-not-valid';
        }

        return $class;
    }