public function setConfig($config)
    {
        if (!$config instanceof HTML_QuickForm2_Rule) {
            throw new HTML_QuickForm2_InvalidArgumentException(
                'Each Rule requires a template Rule to validate with, ' .
                preg_replace('/\s+/', ' ', var_export($config, true)) . ' given'
            );
        } elseif ($config instanceof HTML_QuickForm2_Rule_Required) {
            throw new HTML_QuickForm2_InvalidArgumentException(
                'Cannot use "required" Rule as a template'
            );
        }
        return parent::setConfig($config);
    }