original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Sets the template Rule to use for actual validation
  
  We do not allow using Required rules here, they are able to validate
  containers themselves without the help of Each rule.
  
  @param    HTML_QuickForm2_Rule    Template Rule
  @return   HTML_QuickForm2_Rule
  @throws   HTML_QuickForm2_InvalidArgumentException if $config is either not
  an instance of Rule or is an instance of Rule_Required
docstring_tokens: Sets the template Rule to use for actual validation