original_string: private function packageAppFiles($app)
      {
          $appName = $app->name;
          $zipFileName = $this->zipFilePath;
          $storageServiceId = $app->storage_service_id;
          $storageFolder = $app->storage_container;
  
          if (empty($storageServiceId)) {
              $storageServiceId = $this->getDefaultStorageServiceId();
          }
  
          if (empty($storageServiceId)) {
              throw new InternalServerErrorException("Can not find storage service identifier.");
          }
  
          /** @type FileServiceInterface $storage */
          $storage = ServiceManager::getServiceById($storageServiceId);
          if (!$storage) {
              throw new InternalServerErrorException("Can not find storage service by identifier '$storageServiceId''.");
          }
  
          if ($storage->folderExists($storageFolder)) {
              $storage->getFolderAsZip($storageFolder, $this->zip, $zipFileName, true);
          }
  
          return true;
      }
code: private function packageAppFiles($app)
      {
          $appName = $app->name;
          $zipFileName = $this->zipFilePath;
          $storageServiceId = $app->storage_service_id;
          $storageFolder = $app->storage_container;
  
          if (empty($storageServiceId)) {
              $storageServiceId = $this->getDefaultStorageServiceId();
          }
  
          if (empty($storageServiceId)) {
              throw new InternalServerErrorException("Can not find storage service identifier.");
          }
  
          /** @type FileServiceInterface $storage */
          $storage = ServiceManager::getServiceById($storageServiceId);
          if (!$storage) {
              throw new InternalServerErrorException("Can not find storage service by identifier '$storageServiceId''.");
          }
  
          if ($storage->folderExists($storageFolder)) {
              $storage->getFolderAsZip($storageFolder, $this->zip, $zipFileName, true);
          }
  
          return true;
      }
code_tokens: private function packageAppFiles ( $ app ) { $ appName = $ app -> name ; $ zipFileName = $ this -> zipFilePath ; $ storageServiceId = $ app -> storage_service_id ; $ storageFolder = $ app -> storage_container ; if ( empty ( $ storageServiceId ) ) { $ storageServiceId = $ this -> getDefaultStorageServiceId ( ) ; } if ( empty ( $ storageServiceId ) ) { throw new InternalServerErrorException ( "Can not find storage service identifier." ) ; } /** @type FileServiceInterface $storage */ $ storage = ServiceManager :: getServiceById ( $ storageServiceId ) ; if ( ! $ storage ) { throw new InternalServerErrorException ( "Can not find storage service by identifier '$storageServiceId''." ) ; } if ( $ storage -> folderExists ( $ storageFolder ) ) { $ storage -> getFolderAsZip ( $ storageFolder , $ this -> zip , $ zipFileName , true ) ; } return true ; }
docstring: Package app files for export.
  
  @param $app
  
  @return bool
  @throws \DreamFactory\Core\Exceptions\ForbiddenException
  @throws \DreamFactory\Core\Exceptions\InternalServerErrorException
  @throws \DreamFactory\Core\Exceptions\NotFoundException
docstring_tokens: Package app files for export .