original_string: function _setDefaultRuleMessages(){
          foreach ($this->_rules as $field => $rulesarr){
              foreach ($rulesarr as $key => $rule){
                  if ($rule['message']===null){
                      $a=new stdClass();
                      $a->format=$rule['format'];
                      $str=get_string('err_'.$rule['type'], 'form', $a);
                      if (strpos($str, '[[')!==0){
                          $this->_rules[$field][$key]['message']=$str;
                      }
                  }
              }
          }
      }
code: function _setDefaultRuleMessages(){
          foreach ($this->_rules as $field => $rulesarr){
              foreach ($rulesarr as $key => $rule){
                  if ($rule['message']===null){
                      $a=new stdClass();
                      $a->format=$rule['format'];
                      $str=get_string('err_'.$rule['type'], 'form', $a);
                      if (strpos($str, '[[')!==0){
                          $this->_rules[$field][$key]['message']=$str;
                      }
                  }
              }
          }
      }
code_tokens: function _setDefaultRuleMessages ( ) { foreach ( $ this -> _rules as $ field => $ rulesarr ) { foreach ( $ rulesarr as $ key => $ rule ) { if ( $ rule [ 'message' ] === null ) { $ a = new stdClass ( ) ; $ a -> format = $ rule [ 'format' ] ; $ str = get_string ( 'err_' . $ rule [ 'type' ] , 'form' , $ a ) ; if ( strpos ( $ str , '[[' ) !== 0 ) { $ this -> _rules [ $ field ] [ $ key ] [ 'message' ] = $ str ; } } } } }
docstring: Sets default error message
docstring_tokens: Sets default error message