@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $this->bucket = $bucket; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - public function read(string $key): string|bool |
|
| 97 | + public function read(string $key): string | bool |
|
| 98 | 98 | { |
| 99 | 99 | $this->ensureBucketExists(); |
| 100 | 100 | $path = $this->computePath($key); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | return false; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - public function write(string $key, mixed $content): int|bool |
|
| 130 | + public function write(string $key, mixed $content): int | bool |
|
| 131 | 131 | { |
| 132 | 132 | $this->ensureBucketExists(); |
| 133 | 133 | $path = $this->computePath($key); |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | return $this->listKeys(); |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | - public function mtime(string $key): int|bool |
|
| 217 | + public function mtime(string $key): int | bool |
|
| 218 | 218 | { |
| 219 | 219 | $this->ensureBucketExists(); |
| 220 | 220 | $path = $this->computePath($key); |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | |
| 262 | 262 | public function isDirectory(string $key): bool |
| 263 | 263 | { |
| 264 | - if ($this->exists($key . '/')) { |
|
| 264 | + if ($this->exists($key.'/')) { |
|
| 265 | 265 | return true; |
| 266 | 266 | } |
| 267 | 267 | |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | * @param string $path |
| 397 | 397 | * @param array<string, mixed> $options |
| 398 | 398 | */ |
| 399 | - private function getObjectData(string $path, array $options = []): bool|StorageObject |
|
| 399 | + private function getObjectData(string $path, array $options = []): bool | StorageObject |
|
| 400 | 400 | { |
| 401 | 401 | try { |
| 402 | 402 | return $this->service->objects->get($this->bucket, $path, $options); |
@@ -12,5 +12,5 @@ |
||
| 12 | 12 | /** |
| 13 | 13 | * @return false|string the mime type of the specified key. |
| 14 | 14 | */ |
| 15 | - public function mimeType(string $key): string|bool; |
|
| 15 | + public function mimeType(string $key): string | bool; |
|
| 16 | 16 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | /** |
| 73 | 73 | * {@inheritdoc} |
| 74 | 74 | */ |
| 75 | - public function read(string $key): string|bool |
|
| 75 | + public function read(string $key): string | bool |
|
| 76 | 76 | { |
| 77 | 77 | $this->ensureBucketExists(); |
| 78 | 78 | $options = $this->getOptions($key); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $this->ensureBucketExists(); |
| 102 | 102 | $options = $this->getOptions( |
| 103 | 103 | $targetKey, |
| 104 | - ['CopySource' => $this->bucket . '/' . $this->computePath($sourceKey)] |
|
| 104 | + ['CopySource' => $this->bucket.'/'.$this->computePath($sourceKey)] |
|
| 105 | 105 | ); |
| 106 | 106 | |
| 107 | 107 | try { |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | /** |
| 117 | 117 | * {@inheritdoc} |
| 118 | 118 | */ |
| 119 | - public function write(string $key, mixed $content): int|bool |
|
| 119 | + public function write(string $key, mixed $content): int | bool |
|
| 120 | 120 | { |
| 121 | 121 | $this->ensureBucketExists(); |
| 122 | 122 | $options = $this->getOptions($key); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | /** |
| 155 | 155 | * {@inheritdoc} |
| 156 | 156 | */ |
| 157 | - public function mtime(string $key): int|bool |
|
| 157 | + public function mtime(string $key): int | bool |
|
| 158 | 158 | { |
| 159 | 159 | try { |
| 160 | 160 | $result = $this->service->headObject($this->getOptions($key)); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | return (int) $result->getContentLength(); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - public function mimeType(string $key): string|bool |
|
| 178 | + public function mimeType(string $key): string | bool |
|
| 179 | 179 | { |
| 180 | 180 | $result = $this->service->headObject($this->getOptions($key)); |
| 181 | 181 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | { |
| 235 | 235 | $result = $this->service->listObjectsV2([ |
| 236 | 236 | 'Bucket' => $this->bucket, |
| 237 | - 'Prefix' => rtrim($this->computePath($key), '/') . '/', |
|
| 237 | + 'Prefix' => rtrim($this->computePath($key), '/').'/', |
|
| 238 | 238 | 'MaxKeys' => 1, |
| 239 | 239 | ]); |
| 240 | 240 | |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | return ltrim(substr($path, strlen($this->options['directory'])), '/'); |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | - private function guessContentType(mixed $content): bool|string |
|
| 316 | + private function guessContentType(mixed $content): bool | string |
|
| 317 | 317 | { |
| 318 | 318 | $fileInfo = new \finfo(FILEINFO_MIME_TYPE); |
| 319 | 319 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | /** |
| 116 | 116 | * {@inheritdoc} |
| 117 | 117 | */ |
| 118 | - public function read(string $key): string|bool |
|
| 118 | + public function read(string $key): string | bool |
|
| 119 | 119 | { |
| 120 | 120 | $this->init(); |
| 121 | 121 | list($containerName, $key) = $this->tokenizeKey($key); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | /** |
| 135 | 135 | * {@inheritdoc} |
| 136 | 136 | */ |
| 137 | - public function write(string $key, mixed $content): int|bool |
|
| 137 | + public function write(string $key, mixed $content): int | bool |
|
| 138 | 138 | { |
| 139 | 139 | $this->init(); |
| 140 | 140 | list($containerName, $key) = $this->tokenizeKey($key); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | $containersList = $this->blobProxy->listContainers(); |
| 223 | 223 | |
| 224 | 224 | return call_user_func_array('array_merge', array_map( |
| 225 | - function (Container $container) { |
|
| 225 | + function(Container $container) { |
|
| 226 | 226 | $containerName = $container->getName(); |
| 227 | 227 | |
| 228 | 228 | return $this->fetchBlobs($containerName, $containerName); |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | /** |
| 249 | 249 | * {@inheritdoc} |
| 250 | 250 | */ |
| 251 | - public function mtime(string $key): int|bool |
|
| 251 | + public function mtime(string $key): int | bool |
|
| 252 | 252 | { |
| 253 | 253 | $this->init(); |
| 254 | 254 | list($containerName, $key) = $this->tokenizeKey($key); |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | /** |
| 287 | 287 | * {@inheritdoc} |
| 288 | 288 | */ |
| 289 | - public function mimeType(string $key): string|bool |
|
| 289 | + public function mimeType(string $key): string | bool |
|
| 290 | 290 | { |
| 291 | 291 | $this->init(); |
| 292 | 292 | list($containerName, $key) = $this->tokenizeKey($key); |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | /** |
| 306 | 306 | * {@inheritdoc} |
| 307 | 307 | */ |
| 308 | - public function checksum(string $key): string|bool |
|
| 308 | + public function checksum(string $key): string | bool |
|
| 309 | 309 | { |
| 310 | 310 | $this->init(); |
| 311 | 311 | list($containerName, $key) = $this->tokenizeKey($key); |
@@ -509,10 +509,10 @@ discard block |
||
| 509 | 509 | $blobList = $this->blobProxy->listBlobs($containerName); |
| 510 | 510 | |
| 511 | 511 | return array_map( |
| 512 | - function (Blob $blob) use ($prefix) { |
|
| 512 | + function(Blob $blob) use ($prefix) { |
|
| 513 | 513 | $name = $blob->getName(); |
| 514 | 514 | if (null !== $prefix) { |
| 515 | - $name = $prefix . '/' . $name; |
|
| 515 | + $name = $prefix.'/'.$name; |
|
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | return $name; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * {@inheritdoc} |
| 33 | 33 | */ |
| 34 | - public function read(string $key): string|bool |
|
| 34 | + public function read(string $key): string | bool |
|
| 35 | 35 | { |
| 36 | 36 | try { |
| 37 | 37 | $stream = $this->bucket->openDownloadStreamByName($key); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** |
| 50 | 50 | * {@inheritdoc} |
| 51 | 51 | */ |
| 52 | - public function write(string $key, mixed $content): int|bool |
|
| 52 | + public function write(string $key, mixed $content): int | bool |
|
| 53 | 53 | { |
| 54 | 54 | $stream = $this->bucket->openUploadStream($key, ['metadata' => $this->getMetadata($key)]); |
| 55 | 55 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | /** |
| 116 | 116 | * {@inheritdoc} |
| 117 | 117 | */ |
| 118 | - public function mtime(string $key): int|bool |
|
| 118 | + public function mtime(string $key): int | bool |
|
| 119 | 119 | { |
| 120 | 120 | $file = $this->bucket->findOne(['filename' => $key], ['projection' => ['uploadDate' => 1]]); |
| 121 | 121 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | /** |
| 126 | 126 | * {@inheritdoc} |
| 127 | 127 | */ |
| 128 | - public function checksum(string $key): string|bool |
|
| 128 | + public function checksum(string $key): string | bool |
|
| 129 | 129 | { |
| 130 | 130 | $file = $this->bucket->findOne(['filename' => $key], ['projection' => ['md5' => 1]]); |
| 131 | 131 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | if (isset($this->metadata[$key])) { |
| 163 | 163 | return $this->metadata[$key]; |
| 164 | 164 | } |
| 165 | - $meta = $this->bucket->findOne(['filename' => $key], ['projection' => ['metadata' => 1,'_id' => 0]]); |
|
| 165 | + $meta = $this->bucket->findOne(['filename' => $key], ['projection' => ['metadata' => 1, '_id' => 0]]); |
|
| 166 | 166 | |
| 167 | 167 | if ($meta === null || !isset($meta['metadata'])) { |
| 168 | 168 | return []; |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | if (!$this->exists($key)) { |
| 207 | 207 | return false; |
| 208 | 208 | } |
| 209 | - $size = $this->bucket->findOne(['filename' => $key], ['projection' => ['length' => 1,'_id' => 0]]); |
|
| 209 | + $size = $this->bucket->findOne(['filename' => $key], ['projection' => ['length' => 1, '_id' => 0]]); |
|
| 210 | 210 | if (!isset($size['length'])) { |
| 211 | 211 | return false; |
| 212 | 212 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ]; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - public function read(string $key): string|bool |
|
| 68 | + public function read(string $key): string | bool |
|
| 69 | 69 | { |
| 70 | 70 | return $this->files[$key]['content']; |
| 71 | 71 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | /** |
| 82 | 82 | * @param ?array<string, mixed> $metadata |
| 83 | 83 | */ |
| 84 | - public function write(string $key, mixed $content, array $metadata = null): int|bool |
|
| 84 | + public function write(string $key, mixed $content, array $metadata = null): int | bool |
|
| 85 | 85 | { |
| 86 | 86 | $this->files[$key]['content'] = $content; |
| 87 | 87 | $this->files[$key]['mtime'] = time(); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | return array_keys($this->files); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - public function mtime(string $key): int|bool |
|
| 105 | + public function mtime(string $key): int | bool |
|
| 106 | 106 | { |
| 107 | 107 | return $this->files[$key]['mtime'] ?? false; |
| 108 | 108 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | return false; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - public function mimeType(string $key): bool|string |
|
| 123 | + public function mimeType(string $key): bool | string |
|
| 124 | 124 | { |
| 125 | 125 | $fileInfo = new \finfo(FILEINFO_MIME_TYPE); |
| 126 | 126 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | /** |
| 30 | 30 | * {@inheritdoc} |
| 31 | 31 | */ |
| 32 | - public function read(string $key): string|bool |
|
| 32 | + public function read(string $key): string | bool |
|
| 33 | 33 | { |
| 34 | 34 | return $this->sftp->get($this->computePath($key)); |
| 35 | 35 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | /** |
| 53 | 53 | * {@inheritdoc} |
| 54 | 54 | */ |
| 55 | - public function write(string $key, mixed $content): int|bool |
|
| 55 | + public function write(string $key, mixed $content): int | bool |
|
| 56 | 56 | { |
| 57 | 57 | $this->initialize(); |
| 58 | 58 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | /** |
| 133 | 133 | * {@inheritdoc} |
| 134 | 134 | */ |
| 135 | - public function mtime(string $key): int|bool |
|
| 135 | + public function mtime(string $key): int | bool |
|
| 136 | 136 | { |
| 137 | 137 | $this->initialize(); |
| 138 | 138 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | protected function computePath(string $key): string |
| 198 | 198 | { |
| 199 | - return $this->directory . '/' . ltrim($key, '/'); |
|
| 199 | + return $this->directory.'/'.ltrim($key, '/'); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | /** |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | continue; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - $path = ltrim($directory . '/' . $filename, '/'); |
|
| 220 | + $path = ltrim($directory.'/'.$filename, '/'); |
|
| 221 | 221 | if (isset($stat['type']) && $stat['type'] === NET_SFTP_TYPE_DIRECTORY) { |
| 222 | 222 | $keys['dirs'][] = $path; |
| 223 | 223 | } else { |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | /** |
| 28 | 28 | * {@inheritdoc} |
| 29 | 29 | */ |
| 30 | - public function read(string $key): string|bool |
|
| 30 | + public function read(string $key): string | bool |
|
| 31 | 31 | { |
| 32 | 32 | return $this->adapter->read($key)['contents']; |
| 33 | 33 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | /** |
| 36 | 36 | * {@inheritdoc} |
| 37 | 37 | */ |
| 38 | - public function write(string $key, mixed $content): int|bool |
|
| 38 | + public function write(string $key, mixed $content): int | bool |
|
| 39 | 39 | { |
| 40 | 40 | $metadata = $this->adapter->write($key, $content, $this->config); |
| 41 | 41 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function keys(): array |
| 65 | 65 | { |
| 66 | - return array_map(function ($content) { |
|
| 66 | + return array_map(function($content) { |
|
| 67 | 67 | return $content['path']; |
| 68 | 68 | }, $this->adapter->listContents()); |
| 69 | 69 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | /** |
| 96 | 96 | * {@inheritdoc} |
| 97 | 97 | */ |
| 98 | - public function mtime(string $key): int|bool |
|
| 98 | + public function mtime(string $key): int | bool |
|
| 99 | 99 | { |
| 100 | 100 | return $this->adapter->getTimestamp($key); |
| 101 | 101 | } |
@@ -12,5 +12,5 @@ |
||
| 12 | 12 | /** |
| 13 | 13 | * Returns the checksum of the specified key. |
| 14 | 14 | */ |
| 15 | - public function checksum(string $key): string|bool; |
|
| 15 | + public function checksum(string $key): string | bool; |
|
| 16 | 16 | } |