original_string: protected function handlePaperclipAttachments()
      {
          // Paperclip / attachment attributes
          $attachments = $this->detectPaperclipAttachments();
  
          // Make a list of attributes to insert before the paperclip attributes
          /** @var ModelAttributeData[] $inserts */
          $inserts = [];
  
          foreach ($attachments as $key => $attachment) {
  
              $attribute = new ModelAttributeData([
                  'name'     => $key,
                  'cast'     => AttributeCast::PAPERCLIP_ATTACHMENT,
                  'type'     => $attachment->image ? 'image' : 'file',
              ]);
  
              $inserts[ $key . '_file_name' ] = $attribute;
          }
  
  
          if ( ! count($inserts)) {
              return $this;
          }
  
          $attributes = $this->info->attributes;
  
          foreach ($inserts as $before => $attribute) {
  
              $attributes = $this->insertInArray($attributes, $attribute->name, $attribute, $before);
          }
  
          $this->info->attributes = $attributes;
  
          return $this;
      }
code: protected function handlePaperclipAttachments()
      {
          // Paperclip / attachment attributes
          $attachments = $this->detectPaperclipAttachments();
  
          // Make a list of attributes to insert before the paperclip attributes
          /** @var ModelAttributeData[] $inserts */
          $inserts = [];
  
          foreach ($attachments as $key => $attachment) {
  
              $attribute = new ModelAttributeData([
                  'name'     => $key,
                  'cast'     => AttributeCast::PAPERCLIP_ATTACHMENT,
                  'type'     => $attachment->image ? 'image' : 'file',
              ]);
  
              $inserts[ $key . '_file_name' ] = $attribute;
          }
  
  
          if ( ! count($inserts)) {
              return $this;
          }
  
          $attributes = $this->info->attributes;
  
          foreach ($inserts as $before => $attribute) {
  
              $attributes = $this->insertInArray($attributes, $attribute->name, $attribute, $before);
          }
  
          $this->info->attributes = $attributes;
  
          return $this;
      }
code_tokens: protected function handlePaperclipAttachments ( ) { // Paperclip / attachment attributes $ attachments = $ this -> detectPaperclipAttachments ( ) ; // Make a list of attributes to insert before the paperclip attributes /** @var ModelAttributeData[] $inserts */ $ inserts = [ ] ; foreach ( $ attachments as $ key => $ attachment ) { $ attribute = new ModelAttributeData ( [ 'name' => $ key , 'cast' => AttributeCast :: PAPERCLIP_ATTACHMENT , 'type' => $ attachment -> image ? 'image' : 'file' , ] ) ; $ inserts [ $ key . '_file_name' ] = $ attribute ; } if ( ! count ( $ inserts ) ) { return $ this ; } $ attributes = $ this -> info -> attributes ; foreach ( $ inserts as $ before => $ attribute ) { $ attributes = $ this -> insertInArray ( $ attributes , $ attribute -> name , $ attribute , $ before ) ; } $ this -> info -> attributes = $ attributes ; return $ this ; }
docstring: Handles analysis of paperclip attachments.
  
  @return $this
docstring_tokens: Handles analysis of paperclip attachments .