original_string: public static function createRule($type, HTML_QuickForm2_Node $owner,
                                        $message = '', $config = null)
      {
          $type = strtolower($type);
          if (!isset(self::$registeredRules[$type])) {
              throw new HTML_QuickForm2_InvalidArgumentException("Rule '$type' is not known");
          }
          list($className, $includeFile) = self::$registeredRules[$type];
          if (!class_exists($className)) {
              HTML_QuickForm2_Loader::loadClass($className, $includeFile);
          }
          if (isset(self::$registeredRules[$type][2])) {
              $config = call_user_func(array($className, 'mergeConfig'), $config,
                                       self::$registeredRules[$type][2]);
          }
          return new $className($owner, $message, $config);
      }
code: public static function createRule($type, HTML_QuickForm2_Node $owner,
                                        $message = '', $config = null)
      {
          $type = strtolower($type);
          if (!isset(self::$registeredRules[$type])) {
              throw new HTML_QuickForm2_InvalidArgumentException("Rule '$type' is not known");
          }
          list($className, $includeFile) = self::$registeredRules[$type];
          if (!class_exists($className)) {
              HTML_QuickForm2_Loader::loadClass($className, $includeFile);
          }
          if (isset(self::$registeredRules[$type][2])) {
              $config = call_user_func(array($className, 'mergeConfig'), $config,
                                       self::$registeredRules[$type][2]);
          }
          return new $className($owner, $message, $config);
      }
code_tokens: public static function createRule ( $ type , HTML_QuickForm2_Node $ owner , $ message = '' , $ config = null ) { $ type = strtolower ( $ type ) ; if ( ! isset ( self :: $ registeredRules [ $ type ] ) ) { throw new HTML_QuickForm2_InvalidArgumentException ( "Rule '$type' is not known" ) ; } list ( $ className , $ includeFile ) = self :: $ registeredRules [ $ type ] ; if ( ! class_exists ( $ className ) ) { HTML_QuickForm2_Loader :: loadClass ( $ className , $ includeFile ) ; } if ( isset ( self :: $ registeredRules [ $ type ] [ 2 ] ) ) { $ config = call_user_func ( array ( $ className , 'mergeConfig' ) , $ config , self :: $ registeredRules [ $ type ] [ 2 ] ) ; } return new $ className ( $ owner , $ message , $ config ) ; }
docstring: Creates a new Rule of the given type
  
  @param    string                  Rule type name (treated case-insensitively)
  @param    HTML_QuickForm2_Node    Element to validate by the rule
  @param    string                  Message to display if validation fails
  @param    mixed                   Configuration data for the rule
  @return   HTML_QuickForm2_Rule    A created Rule
  @throws   HTML_QuickForm2_InvalidArgumentException If rule type is unknown
  @throws   HTML_QuickForm2_NotFoundException        If class for the rule
  can't be found and/or loaded from file
docstring_tokens: Creates a new Rule of the given type