@@ -322,7 +322,7 @@ |
||
| 322 | 322 | * @return array{url: ?string, expiration: ?int}|false |
| 323 | 323 | * @since 33.0.0 |
| 324 | 324 | */ |
| 325 | - public function getDirectDownloadById(string $fileId): array|false; |
|
| 325 | + public function getDirectDownloadById(string $fileId): array | false; |
|
| 326 | 326 | |
| 327 | 327 | /** |
| 328 | 328 | * @return void |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - public function filetype(string $path): string|false { |
|
| 48 | + public function filetype(string $path): string | false { |
|
| 49 | 49 | return ($path === '') ? 'dir' : false; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | return $path === ''; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - public function filemtime(string $path): int|false { |
|
| 84 | + public function filemtime(string $path): int | false { |
|
| 85 | 85 | return ($path === '') ? time() : false; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - public function getLocalFile(string $path): string|false { |
|
| 128 | + public function getLocalFile(string $path): string | false { |
|
| 129 | 129 | return false; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -141,11 +141,11 @@ discard block |
||
| 141 | 141 | return false; |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - public function getDirectDownload(string $path): array|false { |
|
| 144 | + public function getDirectDownload(string $path): array | false { |
|
| 145 | 145 | return false; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - public function getDirectDownloadById(string $fileId): array|false { |
|
| 148 | + public function getDirectDownloadById(string $fileId): array | false { |
|
| 149 | 149 | return false; |
| 150 | 150 | } |
| 151 | 151 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | return true; |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | - public function getOwner(string $path): string|false { |
|
| 164 | + public function getOwner(string $path): string | false { |
|
| 165 | 165 | return false; |
| 166 | 166 | } |
| 167 | 167 | |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | * @since 7.0.0 |
| 41 | 41 | */ |
| 42 | 42 | public function readObject($urn) { |
| 43 | - $fh = SeekableHttpStream::open(function ($range) use ($urn) { |
|
| 43 | + $fh = SeekableHttpStream::open(function($range) use ($urn) { |
|
| 44 | 44 | $command = $this->getConnection()->getCommand('GetObject', [ |
| 45 | 45 | 'Bucket' => $this->bucket, |
| 46 | 46 | 'Key' => $urn, |
| 47 | - 'Range' => 'bytes=' . $range, |
|
| 47 | + 'Range' => 'bytes='.$range, |
|
| 48 | 48 | ] + $this->getSSECParameters()); |
| 49 | 49 | $request = \Aws\serialize($command); |
| 50 | 50 | $headers = []; |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | $result = []; |
| 85 | 85 | foreach ($metadata as $key => $value) { |
| 86 | 86 | if (mb_check_encoding($value, 'ASCII')) { |
| 87 | - $result['x-amz-meta-' . $key] = $value; |
|
| 87 | + $result['x-amz-meta-'.$key] = $value; |
|
| 88 | 88 | } else { |
| 89 | - $result['x-amz-meta-' . $key] = 'base64:' . base64_encode($value); |
|
| 89 | + $result['x-amz-meta-'.$key] = 'base64:'.base64_encode($value); |
|
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | return $result; |
@@ -157,12 +157,12 @@ discard block |
||
| 157 | 157 | 'Metadata' => $this->buildS3Metadata($metaData), |
| 158 | 158 | 'StorageClass' => $this->storageClass, |
| 159 | 159 | ] + $this->getSSECParameters(), |
| 160 | - 'before_upload' => function (Command $command) use (&$totalWritten) { |
|
| 160 | + 'before_upload' => function(Command $command) use (&$totalWritten) { |
|
| 161 | 161 | $totalWritten += $command['ContentLength']; |
| 162 | 162 | }, |
| 163 | - 'before_complete' => function ($_command) use (&$totalWritten, $size, &$uploader, &$attempts) { |
|
| 163 | + 'before_complete' => function($_command) use (&$totalWritten, $size, &$uploader, &$attempts) { |
|
| 164 | 164 | if ($size !== null && $totalWritten != $size) { |
| 165 | - $e = new \Exception('Incomplete multi part upload, expected ' . $size . ' bytes, wrote ' . $totalWritten); |
|
| 165 | + $e = new \Exception('Incomplete multi part upload, expected '.$size.' bytes, wrote '.$totalWritten); |
|
| 166 | 166 | throw new MultipartUploadException($uploader->getState(), $e); |
| 167 | 167 | } |
| 168 | 168 | }, |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | 'Key' => $from, |
| 276 | 276 | ] + $this->getSSECParameters()); |
| 277 | 277 | |
| 278 | - $size = (int)($sourceMetadata->get('Size') ?? $sourceMetadata->get('ContentLength')); |
|
| 278 | + $size = (int) ($sourceMetadata->get('Size') ?? $sourceMetadata->get('ContentLength')); |
|
| 279 | 279 | |
| 280 | 280 | if ($this->useMultipartCopy && $size > $this->copySizeLimit) { |
| 281 | 281 | $copy = new MultipartCopy($this->getConnection(), [ |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | try { |
| 311 | - return (string)$this->getConnection()->createPresignedRequest($command, $expiration, [ |
|
| 311 | + return (string) $this->getConnection()->createPresignedRequest($command, $expiration, [ |
|
| 312 | 312 | 'signPayload' => true, |
| 313 | 313 | ])->getUri(); |
| 314 | 314 | } catch (AwsException) { |
@@ -57,17 +57,17 @@ discard block |
||
| 57 | 57 | throw new \Exception('missing IObjectStore instance'); |
| 58 | 58 | } |
| 59 | 59 | if (isset($parameters['storageid'])) { |
| 60 | - $this->id = 'object::store:' . $parameters['storageid']; |
|
| 60 | + $this->id = 'object::store:'.$parameters['storageid']; |
|
| 61 | 61 | } else { |
| 62 | - $this->id = 'object::store:' . $this->objectStore->getStorageId(); |
|
| 62 | + $this->id = 'object::store:'.$this->objectStore->getStorageId(); |
|
| 63 | 63 | } |
| 64 | 64 | if (isset($parameters['objectPrefix'])) { |
| 65 | 65 | $this->objectPrefix = $parameters['objectPrefix']; |
| 66 | 66 | } |
| 67 | 67 | if (isset($parameters['validateWrites'])) { |
| 68 | - $this->validateWrites = (bool)$parameters['validateWrites']; |
|
| 68 | + $this->validateWrites = (bool) $parameters['validateWrites']; |
|
| 69 | 69 | } |
| 70 | - $this->handleCopiesAsOwned = (bool)($parameters['handleCopiesAsOwned'] ?? false); |
|
| 70 | + $this->handleCopiesAsOwned = (bool) ($parameters['handleCopiesAsOwned'] ?? false); |
|
| 71 | 71 | if (isset($parameters['totalSizeLimit'])) { |
| 72 | 72 | $this->totalSizeLimit = $parameters['totalSizeLimit']; |
| 73 | 73 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | } catch (\Exception $ex) { |
| 205 | 205 | if ($ex->getCode() !== 404) { |
| 206 | 206 | $this->logger->error( |
| 207 | - 'Could not delete object ' . $this->getURN($entry->getId()) . ' for ' . $entry->getPath(), |
|
| 207 | + 'Could not delete object '.$this->getURN($entry->getId()).' for '.$entry->getPath(), |
|
| 208 | 208 | [ |
| 209 | 209 | 'app' => 'objectstore', |
| 210 | 210 | 'exception' => $ex, |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | return true; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - public function stat(string $path): array|false { |
|
| 223 | + public function stat(string $path): array | false { |
|
| 224 | 224 | $path = $this->normalizePath($path); |
| 225 | 225 | $cacheEntry = $this->getCache()->get($path); |
| 226 | 226 | if ($cacheEntry instanceof CacheEntry) { |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | * @return string the unified resource name used to identify the object |
| 256 | 256 | */ |
| 257 | 257 | public function getURN(int $fileId): string { |
| 258 | - return $this->objectPrefix . $fileId; |
|
| 258 | + return $this->objectPrefix.$fileId; |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | public function opendir(string $path) { |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | - public function filetype(string $path): string|false { |
|
| 278 | + public function filetype(string $path): string | false { |
|
| 279 | 279 | $path = $this->normalizePath($path); |
| 280 | 280 | $stat = $this->stat($path); |
| 281 | 281 | if ($stat) { |
@@ -316,12 +316,12 @@ discard block |
||
| 316 | 316 | $streamStat = fstat($handle); |
| 317 | 317 | $actualSize = $streamStat['size'] ?? -1; |
| 318 | 318 | if ($actualSize > -1 && $actualSize !== $filesize) { |
| 319 | - $this->getCache()->update((int)$stat['fileid'], ['size' => $actualSize]); |
|
| 319 | + $this->getCache()->update((int) $stat['fileid'], ['size' => $actualSize]); |
|
| 320 | 320 | } |
| 321 | 321 | return $handle; |
| 322 | 322 | } catch (NotFoundException $e) { |
| 323 | 323 | $this->logger->error( |
| 324 | - 'Could not get object ' . $this->getURN($stat['fileid']) . ' for file ' . $path, |
|
| 324 | + 'Could not get object '.$this->getURN($stat['fileid']).' for file '.$path, |
|
| 325 | 325 | [ |
| 326 | 326 | 'app' => 'objectstore', |
| 327 | 327 | 'exception' => $e, |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | throw $e; |
| 331 | 331 | } catch (\Exception $e) { |
| 332 | 332 | $this->logger->error( |
| 333 | - 'Could not get object ' . $this->getURN($stat['fileid']) . ' for file ' . $path, |
|
| 333 | + 'Could not get object '.$this->getURN($stat['fileid']).' for file '.$path, |
|
| 334 | 334 | [ |
| 335 | 335 | 'app' => 'objectstore', |
| 336 | 336 | 'exception' => $e, |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | |
| 355 | 355 | $tmpFile = \OC::$server->getTempManager()->getTemporaryFile($ext); |
| 356 | 356 | $handle = fopen($tmpFile, $mode); |
| 357 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
| 357 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
| 358 | 358 | $this->writeBack($tmpFile, $path); |
| 359 | 359 | unlink($tmpFile); |
| 360 | 360 | }); |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | file_put_contents($tmpFile, $source); |
| 373 | 373 | } |
| 374 | 374 | $handle = fopen($tmpFile, $mode); |
| 375 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
| 375 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
| 376 | 376 | $this->writeBack($tmpFile, $path); |
| 377 | 377 | unlink($tmpFile); |
| 378 | 378 | }); |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | |
| 383 | 383 | public function file_exists(string $path): bool { |
| 384 | 384 | $path = $this->normalizePath($path); |
| 385 | - return (bool)$this->stat($path); |
|
| 385 | + return (bool) $this->stat($path); |
|
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | public function rename(string $source, string $target): bool { |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | return true; |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | - public function getMimeType(string $path): string|false { |
|
| 397 | + public function getMimeType(string $path): string | false { |
|
| 398 | 398 | $path = $this->normalizePath($path); |
| 399 | 399 | return parent::getMimeType($path); |
| 400 | 400 | } |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $this->file_put_contents($path, ' '); |
| 424 | 424 | } catch (\Exception $ex) { |
| 425 | 425 | $this->logger->error( |
| 426 | - 'Could not create object for ' . $path, |
|
| 426 | + 'Could not create object for '.$path, |
|
| 427 | 427 | [ |
| 428 | 428 | 'app' => 'objectstore', |
| 429 | 429 | 'exception' => $ex, |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | } |
| 473 | 473 | // update stat with new data |
| 474 | 474 | $mTime = time(); |
| 475 | - $stat['size'] = (int)$size; |
|
| 475 | + $stat['size'] = (int) $size; |
|
| 476 | 476 | $stat['mtime'] = $mTime; |
| 477 | 477 | $stat['storage_mtime'] = $mTime; |
| 478 | 478 | |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | $stat['checksum'] = ''; |
| 493 | 493 | |
| 494 | 494 | $exists = $this->getCache()->inCache($path); |
| 495 | - $uploadPath = $exists ? $path : $path . '.part'; |
|
| 495 | + $uploadPath = $exists ? $path : $path.'.part'; |
|
| 496 | 496 | |
| 497 | 497 | if ($exists) { |
| 498 | 498 | $fileId = $stat['fileid']; |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | //upload to object storage |
| 510 | 510 | |
| 511 | 511 | $totalWritten = 0; |
| 512 | - $countStream = CountWrapper::wrap($stream, function ($writtenSize) use ($fileId, $size, $exists, &$totalWritten) { |
|
| 512 | + $countStream = CountWrapper::wrap($stream, function($writtenSize) use ($fileId, $size, $exists, &$totalWritten) { |
|
| 513 | 513 | if (is_null($size) && !$exists) { |
| 514 | 514 | $this->getCache()->update($fileId, [ |
| 515 | 515 | 'size' => $writtenSize, |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | */ |
| 537 | 537 | $this->getCache()->remove($uploadPath); |
| 538 | 538 | $this->logger->error( |
| 539 | - 'Could not create object ' . $urn . ' for ' . $path, |
|
| 539 | + 'Could not create object '.$urn.' for '.$path, |
|
| 540 | 540 | [ |
| 541 | 541 | 'app' => 'objectstore', |
| 542 | 542 | 'exception' => $ex, |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | ); |
| 545 | 545 | } else { |
| 546 | 546 | $this->logger->error( |
| 547 | - 'Could not update object ' . $urn . ' for ' . $path, |
|
| 547 | + 'Could not update object '.$urn.' for '.$path, |
|
| 548 | 548 | [ |
| 549 | 549 | 'app' => 'objectstore', |
| 550 | 550 | 'exception' => $ex, |
@@ -708,7 +708,7 @@ discard block |
||
| 708 | 708 | $this->mkdir($to, false, ['size' => $sourceEntry->getSize()]); |
| 709 | 709 | |
| 710 | 710 | foreach ($sourceCache->getFolderContentsById($sourceEntry->getId()) as $child) { |
| 711 | - $this->copyInner($sourceCache, $child, $to . '/' . $child->getName()); |
|
| 711 | + $this->copyInner($sourceCache, $child, $to.'/'.$child->getName()); |
|
| 712 | 712 | } |
| 713 | 713 | } else { |
| 714 | 714 | $this->copyFile($sourceEntry, $to); |
@@ -767,7 +767,7 @@ discard block |
||
| 767 | 767 | $cacheEntry = $this->getCache()->get($targetPath); |
| 768 | 768 | $urn = $this->getURN($cacheEntry->getId()); |
| 769 | 769 | |
| 770 | - $result = $this->objectStore->uploadMultipartPart($urn, $writeToken, (int)$chunkId, $data, $size); |
|
| 770 | + $result = $this->objectStore->uploadMultipartPart($urn, $writeToken, (int) $chunkId, $data, $size); |
|
| 771 | 771 | |
| 772 | 772 | $parts[$chunkId] = [ |
| 773 | 773 | 'PartNumber' => $chunkId, |
@@ -795,10 +795,10 @@ discard block |
||
| 795 | 795 | $stat['mimetype'] = $this->getMimeType($targetPath); |
| 796 | 796 | $this->getCache()->update($stat['fileid'], $stat); |
| 797 | 797 | } |
| 798 | - } catch (S3MultipartUploadException|S3Exception $e) { |
|
| 798 | + } catch (S3MultipartUploadException | S3Exception $e) { |
|
| 799 | 799 | $this->objectStore->abortMultipartUpload($urn, $writeToken); |
| 800 | 800 | $this->logger->error( |
| 801 | - 'Could not complete multipart upload ' . $urn . ' with uploadId ' . $writeToken, |
|
| 801 | + 'Could not complete multipart upload '.$urn.' with uploadId '.$writeToken, |
|
| 802 | 802 | [ |
| 803 | 803 | 'app' => 'objectstore', |
| 804 | 804 | 'exception' => $e, |
@@ -822,7 +822,7 @@ discard block |
||
| 822 | 822 | $this->preserveCacheItemsOnDelete = $preserve; |
| 823 | 823 | } |
| 824 | 824 | |
| 825 | - public function free_space(string $path): int|float|false { |
|
| 825 | + public function free_space(string $path): int | float | false { |
|
| 826 | 826 | if ($this->totalSizeLimit === null) { |
| 827 | 827 | return FileInfo::SPACE_UNLIMITED; |
| 828 | 828 | } |
@@ -847,20 +847,20 @@ discard block |
||
| 847 | 847 | } |
| 848 | 848 | |
| 849 | 849 | #[Override] |
| 850 | - public function getDirectDownloadById(string $fileId): array|false { |
|
| 850 | + public function getDirectDownloadById(string $fileId): array | false { |
|
| 851 | 851 | $expiration = new \DateTimeImmutable('+60 minutes'); |
| 852 | - $url = $this->objectStore->preSignedUrl($this->getURN((int)$fileId), $expiration); |
|
| 852 | + $url = $this->objectStore->preSignedUrl($this->getURN((int) $fileId), $expiration); |
|
| 853 | 853 | return $url ? ['url' => $url, 'expiration' => $expiration->getTimestamp()] : false; |
| 854 | 854 | } |
| 855 | 855 | |
| 856 | 856 | #[Override] |
| 857 | - public function getDirectDownload(string $path): array|false { |
|
| 857 | + public function getDirectDownload(string $path): array | false { |
|
| 858 | 858 | $path = $this->normalizePath($path); |
| 859 | 859 | $cacheEntry = $this->getCache()->get($path); |
| 860 | 860 | |
| 861 | 861 | if (!$cacheEntry || $cacheEntry->getMimeType() === FileInfo::MIMETYPE_FOLDER) { |
| 862 | 862 | return false; |
| 863 | 863 | } |
| 864 | - return $this->getDirectDownloadById((string)$cacheEntry->getId()); |
|
| 864 | + return $this->getDirectDownloadById((string) $cacheEntry->getId()); |
|
| 865 | 865 | } |
| 866 | 866 | } |
@@ -131,7 +131,7 @@ |
||
| 131 | 131 | |
| 132 | 132 | public function copyObject($from, $to) { |
| 133 | 133 | $this->getContainer()->getObject($from)->copy([ |
| 134 | - 'destination' => $this->getContainer()->name . '/' . $to |
|
| 134 | + 'destination' => $this->getContainer()->name.'/'.$to |
|
| 135 | 135 | ]); |
| 136 | 136 | } |
| 137 | 137 | public function preSignedUrl(string $urn, \DateTimeInterface $expiration): ?string { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public function getWrapperStorage(): Storage { |
| 46 | 46 | if (!$this->storage) { |
| 47 | - $message = 'storage wrapper ' . get_class($this) . " doesn't have a wrapped storage set"; |
|
| 47 | + $message = 'storage wrapper '.get_class($this)." doesn't have a wrapped storage set"; |
|
| 48 | 48 | $logger = Server::get(LoggerInterface::class); |
| 49 | 49 | $logger->error($message); |
| 50 | 50 | $this->storage = new FailedStorage(['exception' => new \Exception($message)]); |
@@ -76,15 +76,15 @@ discard block |
||
| 76 | 76 | return $this->getWrapperStorage()->is_file($path); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - public function stat(string $path): array|false { |
|
| 79 | + public function stat(string $path): array | false { |
|
| 80 | 80 | return $this->getWrapperStorage()->stat($path); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - public function filetype(string $path): string|false { |
|
| 83 | + public function filetype(string $path): string | false { |
|
| 84 | 84 | return $this->getWrapperStorage()->filetype($path); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - public function filesize(string $path): int|float|false { |
|
| 87 | + public function filesize(string $path): int | float | false { |
|
| 88 | 88 | return $this->getWrapperStorage()->filesize($path); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -116,15 +116,15 @@ discard block |
||
| 116 | 116 | return $this->getWrapperStorage()->file_exists($path); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - public function filemtime(string $path): int|false { |
|
| 119 | + public function filemtime(string $path): int | false { |
|
| 120 | 120 | return $this->getWrapperStorage()->filemtime($path); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - public function file_get_contents(string $path): string|false { |
|
| 123 | + public function file_get_contents(string $path): string | false { |
|
| 124 | 124 | return $this->getWrapperStorage()->file_get_contents($path); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - public function file_put_contents(string $path, mixed $data): int|float|false { |
|
| 127 | + public function file_put_contents(string $path, mixed $data): int | float | false { |
|
| 128 | 128 | return $this->getWrapperStorage()->file_put_contents($path, $data); |
| 129 | 129 | } |
| 130 | 130 | |
@@ -144,15 +144,15 @@ discard block |
||
| 144 | 144 | return $this->getWrapperStorage()->fopen($path, $mode); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - public function getMimeType(string $path): string|false { |
|
| 147 | + public function getMimeType(string $path): string | false { |
|
| 148 | 148 | return $this->getWrapperStorage()->getMimeType($path); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - public function hash(string $type, string $path, bool $raw = false): string|false { |
|
| 151 | + public function hash(string $type, string $path, bool $raw = false): string | false { |
|
| 152 | 152 | return $this->getWrapperStorage()->hash($type, $path, $raw); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - public function free_space(string $path): int|float|false { |
|
| 155 | + public function free_space(string $path): int | float | false { |
|
| 156 | 156 | return $this->getWrapperStorage()->free_space($path); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | return $this->getWrapperStorage()->touch($path, $mtime); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - public function getLocalFile(string $path): string|false { |
|
| 163 | + public function getLocalFile(string $path): string | false { |
|
| 164 | 164 | return $this->getWrapperStorage()->getLocalFile($path); |
| 165 | 165 | } |
| 166 | 166 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | return $this->getWrapperStorage()->getScanner($path, $storage); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - public function getOwner(string $path): string|false { |
|
| 185 | + public function getOwner(string $path): string | false { |
|
| 186 | 186 | return $this->getWrapperStorage()->getOwner($path); |
| 187 | 187 | } |
| 188 | 188 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | return $this->getWrapperStorage()->getStorageCache(); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - public function getETag(string $path): string|false { |
|
| 214 | + public function getETag(string $path): string | false { |
|
| 215 | 215 | return $this->getWrapperStorage()->getETag($path); |
| 216 | 216 | } |
| 217 | 217 | |
@@ -260,12 +260,12 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | #[Override] |
| 263 | - public function getDirectDownload(string $path): array|false { |
|
| 263 | + public function getDirectDownload(string $path): array | false { |
|
| 264 | 264 | return $this->getWrapperStorage()->getDirectDownload($path); |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | #[Override] |
| 268 | - public function getDirectDownloadById(string $fileId): array|false { |
|
| 268 | + public function getDirectDownloadById(string $fileId): array | false { |
|
| 269 | 269 | return $this->getWrapperStorage()->getDirectDownloadById($fileId); |
| 270 | 270 | } |
| 271 | 271 | |
@@ -107,15 +107,15 @@ discard block |
||
| 107 | 107 | return $this->handleAvailability('is_file', $path); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - public function stat(string $path): array|false { |
|
| 110 | + public function stat(string $path): array | false { |
|
| 111 | 111 | return $this->handleAvailability('stat', $path); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - public function filetype(string $path): string|false { |
|
| 114 | + public function filetype(string $path): string | false { |
|
| 115 | 115 | return $this->handleAvailability('filetype', $path); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - public function filesize(string $path): int|float|false { |
|
| 118 | + public function filesize(string $path): int | float | false { |
|
| 119 | 119 | return $this->handleAvailability('filesize', $path); |
| 120 | 120 | } |
| 121 | 121 | |
@@ -150,15 +150,15 @@ discard block |
||
| 150 | 150 | return $this->handleAvailability('file_exists', $path); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - public function filemtime(string $path): int|false { |
|
| 153 | + public function filemtime(string $path): int | false { |
|
| 154 | 154 | return $this->handleAvailability('filemtime', $path); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - public function file_get_contents(string $path): string|false { |
|
| 157 | + public function file_get_contents(string $path): string | false { |
|
| 158 | 158 | return $this->handleAvailability('file_get_contents', $path); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - public function file_put_contents(string $path, mixed $data): int|float|false { |
|
| 161 | + public function file_put_contents(string $path, mixed $data): int | float | false { |
|
| 162 | 162 | return $this->handleAvailability('file_put_contents', $path, $data); |
| 163 | 163 | } |
| 164 | 164 | |
@@ -178,15 +178,15 @@ discard block |
||
| 178 | 178 | return $this->handleAvailability('fopen', $path, $mode); |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - public function getMimeType(string $path): string|false { |
|
| 181 | + public function getMimeType(string $path): string | false { |
|
| 182 | 182 | return $this->handleAvailability('getMimeType', $path); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - public function hash(string $type, string $path, bool $raw = false): string|false { |
|
| 185 | + public function hash(string $type, string $path, bool $raw = false): string | false { |
|
| 186 | 186 | return $this->handleAvailability('hash', $type, $path, $raw); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - public function free_space(string $path): int|float|false { |
|
| 189 | + public function free_space(string $path): int | float | false { |
|
| 190 | 190 | return $this->handleAvailability('free_space', $path); |
| 191 | 191 | } |
| 192 | 192 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | return $this->handleAvailability('touch', $path, $mtime); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - public function getLocalFile(string $path): string|false { |
|
| 197 | + public function getLocalFile(string $path): string | false { |
|
| 198 | 198 | return $this->handleAvailability('getLocalFile', $path); |
| 199 | 199 | } |
| 200 | 200 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - public function getOwner(string $path): string|false { |
|
| 214 | + public function getOwner(string $path): string | false { |
|
| 215 | 215 | try { |
| 216 | 216 | return parent::getOwner($path); |
| 217 | 217 | } catch (StorageNotAvailableException $e) { |
@@ -220,15 +220,15 @@ discard block |
||
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - public function getETag(string $path): string|false { |
|
| 223 | + public function getETag(string $path): string | false { |
|
| 224 | 224 | return $this->handleAvailability('getETag', $path); |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - public function getDirectDownload(string $path): array|false { |
|
| 227 | + public function getDirectDownload(string $path): array | false { |
|
| 228 | 228 | return $this->handleAvailability('getDirectDownload', $path); |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - public function getDirectDownloadById(string $fileId): array|false { |
|
| 231 | + public function getDirectDownloadById(string $fileId): array | false { |
|
| 232 | 232 | return $this->handleAvailability('getDirectDownloadById', $fileId); |
| 233 | 233 | } |
| 234 | 234 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | return $this->filetype($path) === 'file'; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - public function filesize(string $path): int|float|false { |
|
| 94 | + public function filesize(string $path): int | float | false { |
|
| 95 | 95 | if ($this->is_dir($path)) { |
| 96 | 96 | return 0; //by definition |
| 97 | 97 | } else { |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | return $permissions; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - public function filemtime(string $path): int|false { |
|
| 155 | + public function filemtime(string $path): int | false { |
|
| 156 | 156 | $stat = $this->stat($path); |
| 157 | 157 | if (isset($stat['mtime']) && $stat['mtime'] > 0) { |
| 158 | 158 | return $stat['mtime']; |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | - public function file_get_contents(string $path): string|false { |
|
| 164 | + public function file_get_contents(string $path): string | false { |
|
| 165 | 165 | $handle = $this->fopen($path, 'r'); |
| 166 | 166 | if (!$handle) { |
| 167 | 167 | return false; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | return $data; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - public function file_put_contents(string $path, mixed $data): int|float|false { |
|
| 174 | + public function file_put_contents(string $path, mixed $data): int | float | false { |
|
| 175 | 175 | $handle = $this->fopen($path, 'w'); |
| 176 | 176 | if (!$handle) { |
| 177 | 177 | return false; |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $this->mkdir($target); |
| 197 | 197 | while (($file = readdir($dir)) !== false) { |
| 198 | 198 | if (!Filesystem::isIgnoredDir($file)) { |
| 199 | - if (!$this->copy($source . '/' . $file, $target . '/' . $file)) { |
|
| 199 | + if (!$this->copy($source.'/'.$file, $target.'/'.$file)) { |
|
| 200 | 200 | closedir($dir); |
| 201 | 201 | return false; |
| 202 | 202 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | } |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - public function getMimeType(string $path): string|false { |
|
| 219 | + public function getMimeType(string $path): string | false { |
|
| 220 | 220 | if ($this->is_dir($path)) { |
| 221 | 221 | return 'httpd/unix-directory'; |
| 222 | 222 | } elseif ($this->file_exists($path)) { |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - public function hash(string $type, string $path, bool $raw = false): string|false { |
|
| 229 | + public function hash(string $type, string $path, bool $raw = false): string | false { |
|
| 230 | 230 | $fh = $this->fopen($path, 'rb'); |
| 231 | 231 | if (!$fh) { |
| 232 | 232 | return false; |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | return hash_final($ctx, $raw); |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | - public function getLocalFile(string $path): string|false { |
|
| 240 | + public function getLocalFile(string $path): string | false { |
|
| 241 | 241 | return $this->getCachedFile($path); |
| 242 | 242 | } |
| 243 | 243 | |
@@ -246,12 +246,12 @@ discard block |
||
| 246 | 246 | if (is_resource($dh)) { |
| 247 | 247 | while (($file = readdir($dh)) !== false) { |
| 248 | 248 | if (!Filesystem::isIgnoredDir($file)) { |
| 249 | - if ($this->is_dir($path . '/' . $file)) { |
|
| 250 | - mkdir($target . '/' . $file); |
|
| 251 | - $this->addLocalFolder($path . '/' . $file, $target . '/' . $file); |
|
| 249 | + if ($this->is_dir($path.'/'.$file)) { |
|
| 250 | + mkdir($target.'/'.$file); |
|
| 251 | + $this->addLocalFolder($path.'/'.$file, $target.'/'.$file); |
|
| 252 | 252 | } else { |
| 253 | - $tmp = $this->toTmpFile($path . '/' . $file); |
|
| 254 | - rename($tmp, $target . '/' . $file); |
|
| 253 | + $tmp = $this->toTmpFile($path.'/'.$file); |
|
| 254 | + rename($tmp, $target.'/'.$file); |
|
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | } |
@@ -267,10 +267,10 @@ discard block |
||
| 267 | 267 | continue; |
| 268 | 268 | } |
| 269 | 269 | if (strstr(strtolower($item), strtolower($query)) !== false) { |
| 270 | - $files[] = $dir . '/' . $item; |
|
| 270 | + $files[] = $dir.'/'.$item; |
|
| 271 | 271 | } |
| 272 | - if ($this->is_dir($dir . '/' . $item)) { |
|
| 273 | - $files = array_merge($files, $this->searchInDir($query, $dir . '/' . $item)); |
|
| 272 | + if ($this->is_dir($dir.'/'.$item)) { |
|
| 273 | + $files = array_merge($files, $this->searchInDir($query, $dir.'/'.$item)); |
|
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | 276 | } |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | if (!isset($this->watcher)) { |
| 331 | 331 | $this->watcher = new Watcher($storage); |
| 332 | 332 | $globalPolicy = Server::get(IConfig::class)->getSystemValueInt('filesystem_check_changes', Watcher::CHECK_NEVER); |
| 333 | - $this->watcher->setPolicy((int)$this->getMountOption('filesystem_check_changes', $globalPolicy)); |
|
| 333 | + $this->watcher->setPolicy((int) $this->getMountOption('filesystem_check_changes', $globalPolicy)); |
|
| 334 | 334 | } |
| 335 | 335 | return $this->watcher; |
| 336 | 336 | } |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | /** @var self $storage */ |
| 346 | 346 | if (!isset($storage->propagator)) { |
| 347 | 347 | $config = Server::get(IConfig::class); |
| 348 | - $storage->propagator = new Propagator($storage, \OC::$server->getDatabaseConnection(), ['appdata_' . $config->getSystemValueString('instanceid')]); |
|
| 348 | + $storage->propagator = new Propagator($storage, \OC::$server->getDatabaseConnection(), ['appdata_'.$config->getSystemValueString('instanceid')]); |
|
| 349 | 349 | } |
| 350 | 350 | return $storage->propagator; |
| 351 | 351 | } |
@@ -366,11 +366,11 @@ discard block |
||
| 366 | 366 | |
| 367 | 367 | public function getStorageCache(?IStorage $storage = null): \OC\Files\Cache\Storage { |
| 368 | 368 | /** @var Cache $cache */ |
| 369 | - $cache = $this->getCache(storage: $storage); |
|
| 369 | + $cache = $this->getCache(storage : $storage); |
|
| 370 | 370 | return $cache->getStorageCache(); |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | - public function getOwner(string $path): string|false { |
|
| 373 | + public function getOwner(string $path): string | false { |
|
| 374 | 374 | if ($this->owner === null) { |
| 375 | 375 | $this->owner = \OC_User::getUser(); |
| 376 | 376 | } |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | return $this->owner; |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | - public function getETag(string $path): string|false { |
|
| 381 | + public function getETag(string $path): string | false { |
|
| 382 | 382 | return uniqid(); |
| 383 | 383 | } |
| 384 | 384 | |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | */ |
| 392 | 392 | public function cleanPath(string $path): string { |
| 393 | 393 | if (strlen($path) == 0 || $path[0] != '/') { |
| 394 | - $path = '/' . $path; |
|
| 394 | + $path = '/'.$path; |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | $output = []; |
@@ -418,14 +418,14 @@ discard block |
||
| 418 | 418 | return false; |
| 419 | 419 | } catch (\Exception $e) { |
| 420 | 420 | Server::get(LoggerInterface::class)->warning( |
| 421 | - 'External storage not available: ' . $e->getMessage(), |
|
| 421 | + 'External storage not available: '.$e->getMessage(), |
|
| 422 | 422 | ['exception' => $e] |
| 423 | 423 | ); |
| 424 | 424 | return false; |
| 425 | 425 | } |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | - public function free_space(string $path): int|float|false { |
|
| 428 | + public function free_space(string $path): int | float | false { |
|
| 429 | 429 | return \OCP\Files\FileInfo::SPACE_UNKNOWN; |
| 430 | 430 | } |
| 431 | 431 | |
@@ -447,12 +447,12 @@ discard block |
||
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | #[Override] |
| 450 | - public function getDirectDownload(string $path): array|false { |
|
| 450 | + public function getDirectDownload(string $path): array | false { |
|
| 451 | 451 | return false; |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | #[Override] |
| 455 | - public function getDirectDownloadById(string $fileId): array|false { |
|
| 455 | + public function getDirectDownloadById(string $fileId): array | false { |
|
| 456 | 456 | return false; |
| 457 | 457 | } |
| 458 | 458 | |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | $result = true; |
| 506 | 506 | while ($result && ($file = readdir($dh)) !== false) { |
| 507 | 507 | if (!Filesystem::isIgnoredDir($file)) { |
| 508 | - $result &= $this->copyFromStorage($sourceStorage, $sourceInternalPath . '/' . $file, $targetInternalPath . '/' . $file); |
|
| 508 | + $result &= $this->copyFromStorage($sourceStorage, $sourceInternalPath.'/'.$file, $targetInternalPath.'/'.$file); |
|
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | } |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | $this->getCache()->remove($targetInternalPath); |
| 534 | 534 | } |
| 535 | 535 | } |
| 536 | - return (bool)$result; |
|
| 536 | + return (bool) $result; |
|
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | /** |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | |
| 596 | 596 | public function getMetaData(string $path): ?array { |
| 597 | 597 | if (Filesystem::isFileBlacklisted($path)) { |
| 598 | - throw new ForbiddenException('Invalid path: ' . $path, false); |
|
| 598 | + throw new ForbiddenException('Invalid path: '.$path, false); |
|
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | $permissions = $this->getPermissions($path); |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | ); |
| 641 | 641 | } |
| 642 | 642 | try { |
| 643 | - $provider->acquireLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type, $this->getId() . '::' . $path); |
|
| 643 | + $provider->acquireLock('files/'.md5($this->getId().'::'.trim($path, '/')), $type, $this->getId().'::'.$path); |
|
| 644 | 644 | } catch (LockedException $e) { |
| 645 | 645 | $e = new LockedException($e->getPath(), $e, $e->getExistingLock(), $path); |
| 646 | 646 | if ($logger) { |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | ); |
| 668 | 668 | } |
| 669 | 669 | try { |
| 670 | - $provider->releaseLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type); |
|
| 670 | + $provider->releaseLock('files/'.md5($this->getId().'::'.trim($path, '/')), $type); |
|
| 671 | 671 | } catch (LockedException $e) { |
| 672 | 672 | $e = new LockedException($e->getPath(), $e, $e->getExistingLock(), $path); |
| 673 | 673 | if ($logger) { |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | ); |
| 695 | 695 | } |
| 696 | 696 | try { |
| 697 | - $provider->changeLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type); |
|
| 697 | + $provider->changeLock('files/'.md5($this->getId().'::'.trim($path, '/')), $type); |
|
| 698 | 698 | } catch (LockedException $e) { |
| 699 | 699 | $e = new LockedException($e->getPath(), $e, $e->getExistingLock(), $path); |
| 700 | 700 | if ($logger) { |
@@ -759,7 +759,7 @@ discard block |
||
| 759 | 759 | $basePath = rtrim($directory, '/'); |
| 760 | 760 | while (($file = readdir($dh)) !== false) { |
| 761 | 761 | if (!Filesystem::isIgnoredDir($file)) { |
| 762 | - $childPath = $basePath . '/' . trim($file, '/'); |
|
| 762 | + $childPath = $basePath.'/'.trim($file, '/'); |
|
| 763 | 763 | $metadata = $this->getMetaData($childPath); |
| 764 | 764 | if ($metadata !== null) { |
| 765 | 765 | yield $metadata; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | // this is probably because some code path has caused recursion during the share setup |
| 137 | 137 | // we setup a "failed storage" so `getWrapperStorage` doesn't return null. |
| 138 | 138 | // If the share setup completes after this the "failed storage" will be overwritten by the correct one |
| 139 | - $ex = new \Exception('Possible share setup recursion detected for share ' . $this->superShare->getId()); |
|
| 139 | + $ex = new \Exception('Possible share setup recursion detected for share '.$this->superShare->getId()); |
|
| 140 | 140 | $this->logger->warning($ex->getMessage(), ['exception' => $ex, 'app' => 'files_sharing']); |
| 141 | 141 | $this->storage = new FailedStorage(['exception' => $ex]); |
| 142 | 142 | $this->cache = new FailedCache(); |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | public function getId(): string { |
| 241 | - return 'shared::' . $this->getMountPoint(); |
|
| 241 | + return 'shared::'.$this->getMountPoint(); |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | public function getPermissions(string $path = ''): int { |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | public function isCreatable(string $path): bool { |
| 263 | - return (bool)($this->getPermissions($path) & Constants::PERMISSION_CREATE); |
|
| 263 | + return (bool) ($this->getPermissions($path) & Constants::PERMISSION_CREATE); |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | public function isReadable(string $path): bool { |
@@ -277,18 +277,18 @@ discard block |
||
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | public function isUpdatable(string $path): bool { |
| 280 | - return (bool)($this->getPermissions($path) & Constants::PERMISSION_UPDATE); |
|
| 280 | + return (bool) ($this->getPermissions($path) & Constants::PERMISSION_UPDATE); |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | public function isDeletable(string $path): bool { |
| 284 | - return (bool)($this->getPermissions($path) & Constants::PERMISSION_DELETE); |
|
| 284 | + return (bool) ($this->getPermissions($path) & Constants::PERMISSION_DELETE); |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | public function isSharable(string $path): bool { |
| 288 | 288 | if (Util::isSharingDisabledForUser() || !Share::isResharingAllowed()) { |
| 289 | 289 | return false; |
| 290 | 290 | } |
| 291 | - return (bool)($this->getPermissions($path) & Constants::PERMISSION_SHARE); |
|
| 291 | + return (bool) ($this->getPermissions($path) & Constants::PERMISSION_SHARE); |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | public function fopen(string $path, string $mode) { |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | } |
| 336 | 336 | } |
| 337 | 337 | $info = [ |
| 338 | - 'target' => $this->getMountPoint() . '/' . $path, |
|
| 338 | + 'target' => $this->getMountPoint().'/'.$path, |
|
| 339 | 339 | 'source' => $source, |
| 340 | 340 | 'mode' => $mode, |
| 341 | 341 | ]; |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | return new Scanner($storage); |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | - public function getOwner(string $path): string|false { |
|
| 432 | + public function getOwner(string $path): string | false { |
|
| 433 | 433 | return $this->superShare->getShareOwner(); |
| 434 | 434 | } |
| 435 | 435 | |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | * @psalm-suppress DocblockTypeContradiction |
| 524 | 524 | */ |
| 525 | 525 | if (!$this->storage) { |
| 526 | - $message = 'no storage set after init for share ' . $this->getShareId(); |
|
| 526 | + $message = 'no storage set after init for share '.$this->getShareId(); |
|
| 527 | 527 | $this->logger->error($message); |
| 528 | 528 | $this->storage = new FailedStorage(['exception' => new \Exception($message)]); |
| 529 | 529 | } |
@@ -531,18 +531,18 @@ discard block |
||
| 531 | 531 | return $this->storage; |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | - public function file_get_contents(string $path): string|false { |
|
| 534 | + public function file_get_contents(string $path): string | false { |
|
| 535 | 535 | $info = [ |
| 536 | - 'target' => $this->getMountPoint() . '/' . $path, |
|
| 536 | + 'target' => $this->getMountPoint().'/'.$path, |
|
| 537 | 537 | 'source' => $this->getUnjailedPath($path), |
| 538 | 538 | ]; |
| 539 | 539 | Util::emitHook('\OC\Files\Storage\Shared', 'file_get_contents', $info); |
| 540 | 540 | return parent::file_get_contents($path); |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | - public function file_put_contents(string $path, mixed $data): int|float|false { |
|
| 543 | + public function file_put_contents(string $path, mixed $data): int | float | false { |
|
| 544 | 544 | $info = [ |
| 545 | - 'target' => $this->getMountPoint() . '/' . $path, |
|
| 545 | + 'target' => $this->getMountPoint().'/'.$path, |
|
| 546 | 546 | 'source' => $this->getUnjailedPath($path), |
| 547 | 547 | ]; |
| 548 | 548 | Util::emitHook('\OC\Files\Storage\Shared', 'file_put_contents', $info); |
@@ -560,13 +560,13 @@ discard block |
||
| 560 | 560 | } |
| 561 | 561 | |
| 562 | 562 | #[Override] |
| 563 | - public function getDirectDownload(string $path): array|false { |
|
| 563 | + public function getDirectDownload(string $path): array | false { |
|
| 564 | 564 | // disable direct download for shares |
| 565 | 565 | return false; |
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | #[Override] |
| 569 | - public function getDirectDownloadById(string $fileId): array|false { |
|
| 569 | + public function getDirectDownloadById(string $fileId): array | false { |
|
| 570 | 570 | // disable direct download for shares |
| 571 | 571 | return false; |
| 572 | 572 | } |