original_string: public function formatAttribute($attributes = [])
      {
          $attributes = $attributes ?: $this->attributes;
  
          if ($this->hasFile()) {
              $attributes['enctype'] = 'multipart/form-data';
          }
  
          $html = [];
          foreach ($attributes as $key => $val) {
              $html[] = "$key=\"$val\"";
          }
  
          return implode(' ', $html) ?: '';
      }
code: public function formatAttribute($attributes = [])
      {
          $attributes = $attributes ?: $this->attributes;
  
          if ($this->hasFile()) {
              $attributes['enctype'] = 'multipart/form-data';
          }
  
          $html = [];
          foreach ($attributes as $key => $val) {
              $html[] = "$key=\"$val\"";
          }
  
          return implode(' ', $html) ?: '';
      }
code_tokens: public function formatAttribute ( $ attributes = [ ] ) { $ attributes = $ attributes ? : $ this -> attributes ; if ( $ this -> hasFile ( ) ) { $ attributes [ 'enctype' ] = 'multipart/form-data' ; } $ html = [ ] ; foreach ( $ attributes as $ key => $ val ) { $ html [ ] = "$key=\"$val\"" ; } return implode ( ' ' , $ html ) ? : '' ; }
docstring: Format form attributes form array to html.
  
  @param array $attributes
  
  @return string
docstring_tokens: Format form attributes form array to html .