original_string: public function getAttachments($mail)
      {
          /** @noinspection IsEmptyFunctionUsageInspection */
          if(empty($mail->getId())) {
              return [];
          }
          
          $folderFileList = $this->getMailLocalFolderFileList($mail);
  
          $attachments = [];
          
          foreach ($folderFileList as $filePath => $fileMetaData) {
  
              $filePath = $fileMetaData['path'];
  
              /** @var \Shockwavemk\Mail\Base\Model\Mail\Attachment $attachment */
              $attachment = $this->_objectManager
                  ->create('\Shockwavemk\Mail\Base\Model\Mail\Attachment');
  
              $attachment->setFilePath($filePath);
              $attachment->setMail($mail);
  
              // transfer all meta data into attachment object
              foreach ($fileMetaData as $attributeKey => $attributeValue) {
                  $attachment->setData($attributeKey, $attributeValue);
              }
  
              $attachments[$filePath] = $attachment;
          }
  
          return $attachments;
      }
code: public function getAttachments($mail)
      {
          /** @noinspection IsEmptyFunctionUsageInspection */
          if(empty($mail->getId())) {
              return [];
          }
          
          $folderFileList = $this->getMailLocalFolderFileList($mail);
  
          $attachments = [];
          
          foreach ($folderFileList as $filePath => $fileMetaData) {
  
              $filePath = $fileMetaData['path'];
  
              /** @var \Shockwavemk\Mail\Base\Model\Mail\Attachment $attachment */
              $attachment = $this->_objectManager
                  ->create('\Shockwavemk\Mail\Base\Model\Mail\Attachment');
  
              $attachment->setFilePath($filePath);
              $attachment->setMail($mail);
  
              // transfer all meta data into attachment object
              foreach ($fileMetaData as $attributeKey => $attributeValue) {
                  $attachment->setData($attributeKey, $attributeValue);
              }
  
              $attachments[$filePath] = $attachment;
          }
  
          return $attachments;
      }
code_tokens: public function getAttachments ( $ mail ) { /** @noinspection IsEmptyFunctionUsageInspection */ if ( empty ( $ mail -> getId ( ) ) ) { return [ ] ; } $ folderFileList = $ this -> getMailLocalFolderFileList ( $ mail ) ; $ attachments = [ ] ; foreach ( $ folderFileList as $ filePath => $ fileMetaData ) { $ filePath = $ fileMetaData [ 'path' ] ; /** @var \Shockwavemk\Mail\Base\Model\Mail\Attachment $attachment */ $ attachment = $ this -> _objectManager -> create ( '\Shockwavemk\Mail\Base\Model\Mail\Attachment' ) ; $ attachment -> setFilePath ( $ filePath ) ; $ attachment -> setMail ( $ mail ) ; // transfer all meta data into attachment object foreach ( $ fileMetaData as $ attributeKey => $ attributeValue ) { $ attachment -> setData ( $ attributeKey , $ attributeValue ) ; } $ attachments [ $ filePath ] = $ attachment ; } return $ attachments ; }
docstring: Returns attachments for a given mail
  
  \Shockwavemk\Mail\Base\Model\Mail $mail
  
  @return \Shockwavemk\Mail\Base\Model\Mail\Attachment[]
docstring_tokens: Returns attachments for a given mail