original_string: protected function storeFile($data, $filePath)
      {
          // create a folder for message if needed
          if (!is_dir(dirname($filePath))) {
              $this->createFolder(dirname($filePath));
          }
  
          /** @noinspection LoopWhichDoesNotLoopInspection */
          for ($i = 0; $i < $this->_config->getHostRetryLimit(); $i++) {
              /* We try an exclusive creation of the file.
               * This is an atomic operation, it avoid locking mechanism
               */
              $fp = @fopen($filePath, 'x');
  
              if($fp !== false) {
                  if (false === fwrite($fp, $data)) {
                      return false;
                  }
  
                  fclose($fp);
  
                  return $filePath;
              }
          }
  
          throw new FileSystemException(
              new Phrase('Unable to create a file for enqueuing Message')
          );
      }
code: protected function storeFile($data, $filePath)
      {
          // create a folder for message if needed
          if (!is_dir(dirname($filePath))) {
              $this->createFolder(dirname($filePath));
          }
  
          /** @noinspection LoopWhichDoesNotLoopInspection */
          for ($i = 0; $i < $this->_config->getHostRetryLimit(); $i++) {
              /* We try an exclusive creation of the file.
               * This is an atomic operation, it avoid locking mechanism
               */
              $fp = @fopen($filePath, 'x');
  
              if($fp !== false) {
                  if (false === fwrite($fp, $data)) {
                      return false;
                  }
  
                  fclose($fp);
  
                  return $filePath;
              }
          }
  
          throw new FileSystemException(
              new Phrase('Unable to create a file for enqueuing Message')
          );
      }
code_tokens: protected function storeFile ( $ data , $ filePath ) { // create a folder for message if needed if ( ! is_dir ( dirname ( $ filePath ) ) ) { $ this -> createFolder ( dirname ( $ filePath ) ) ; } /** @noinspection LoopWhichDoesNotLoopInspection */ for ( $ i = 0 ; $ i < $ this -> _config -> getHostRetryLimit ( ) ; $ i ++ ) { /* We try an exclusive creation of the file.
               * This is an atomic operation, it avoid locking mechanism
               */ $ fp = @ fopen ( $ filePath , 'x' ) ; if ( $ fp !== false ) { if ( false === fwrite ( $ fp , $ data ) ) { return false ; } fclose ( $ fp ) ; return $ filePath ; } } throw new FileSystemException ( new Phrase ( 'Unable to create a file for enqueuing Message' ) ) ; }
docstring: Stores string data at a given path
  
  @param $data
  @param $filePath
  @return bool
  @throws \Magento\Framework\Exception\FileSystemException
  @throws \Exception
docstring_tokens: Stores string data at a given path