original_string: protected function addRequiredAttribute($rules)
      {
          if (!in_array('required', $rules)) {
              return;
          }
  
          if ($this instanceof Form\Field\MultipleFile
              || $this instanceof Form\Field\File) {
              return;
          }
  
          $this->required();
      }
code: protected function addRequiredAttribute($rules)
      {
          if (!in_array('required', $rules)) {
              return;
          }
  
          if ($this instanceof Form\Field\MultipleFile
              || $this instanceof Form\Field\File) {
              return;
          }
  
          $this->required();
      }
code_tokens: protected function addRequiredAttribute ( $ rules ) { if ( ! in_array ( 'required' , $ rules ) ) { return ; } if ( $ this instanceof Form \ Field \ MultipleFile || $ this instanceof Form \ Field \ File ) { return ; } $ this -> required ( ) ; }
docstring: Add `required` attribute to current field if has required rule,
  except file and image fields.
  
  @param array $rules
docstring_tokens: Add required attribute to current field if has required rule except file and image fields .