original_string: public function markRequired($elTpl, $required)
      {
          if ($required) {
              $this->hasRequired = true;
              $elTpl = str_replace(array('<qf:required>', '</qf:required>'),
                                    array('', ''), $elTpl);
          } else {
              $elTpl = preg_replace('!<qf:required>.*</qf:required>!isU', '', $elTpl);
          }
          return $elTpl;
      }
code: public function markRequired($elTpl, $required)
      {
          if ($required) {
              $this->hasRequired = true;
              $elTpl = str_replace(array('<qf:required>', '</qf:required>'),
                                    array('', ''), $elTpl);
          } else {
              $elTpl = preg_replace('!<qf:required>.*</qf:required>!isU', '', $elTpl);
          }
          return $elTpl;
      }
code_tokens: public function markRequired ( $ elTpl , $ required ) { if ( $ required ) { $ this -> hasRequired = true ; $ elTpl = str_replace ( array ( '<qf:required>' , '</qf:required>' ) , array ( '' , '' ) , $ elTpl ) ; } else { $ elTpl = preg_replace ( '!<qf:required>.*</qf:required>!isU' , '' , $ elTpl ) ; } return $ elTpl ; }
docstring: Marks element required or removes "required" block
  
  @param    string  Element template
  @param    bool    Whether element is required
  @return   string  Template with processed "required" block
docstring_tokens: Marks element required or removes required block