@@ -264,8 +264,8 @@ |
||
| 264 | 264 | $this->fileData = array_merge($fileData, $this->fileData); |
| 265 | 265 | |
| 266 | 266 | return [ |
| 267 | - 'keys' => array_keys($fileData), |
|
| 268 | - 'dirs' => $dirs, |
|
| 267 | + 'keys' => array_keys($fileData), |
|
| 268 | + 'dirs' => $dirs, |
|
| 269 | 269 | ]; |
| 270 | 270 | } |
| 271 | 271 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $this->utf8 = $options['utf8'] ?? false; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function read(string $key): string|bool |
|
| 55 | + public function read(string $key): string | bool |
|
| 56 | 56 | { |
| 57 | 57 | $this->ensureDirectoryExists($this->directory, $this->create); |
| 58 | 58 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | return $contents; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - public function write(string $key, mixed $content): int|bool |
|
| 72 | + public function write(string $key, mixed $content): int | bool |
|
| 73 | 73 | { |
| 74 | 74 | $this->ensureDirectoryExists($this->directory, $this->create); |
| 75 | 75 | |
@@ -110,13 +110,13 @@ discard block |
||
| 110 | 110 | $this->ensureDirectoryExists($this->directory, $this->create); |
| 111 | 111 | |
| 112 | 112 | $file = $this->computePath($key); |
| 113 | - $lines = ftp_rawlist($this->getConnection(), '-al ' . \Gaufrette\Util\Path::dirname($file)); |
|
| 113 | + $lines = ftp_rawlist($this->getConnection(), '-al '.\Gaufrette\Util\Path::dirname($file)); |
|
| 114 | 114 | |
| 115 | 115 | if (false === $lines) { |
| 116 | 116 | return false; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - $pattern = '{(?<!->) ' . preg_quote(basename($file)) . '( -> |$)}m'; |
|
| 119 | + $pattern = '{(?<!->) '.preg_quote(basename($file)).'( -> |$)}m'; |
|
| 120 | 120 | foreach ($lines as $line) { |
| 121 | 121 | if (preg_match($pattern, $line)) { |
| 122 | 122 | return true; |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | return $filteredKeys; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - public function mtime(string $key): int|bool |
|
| 167 | + public function mtime(string $key): int | bool |
|
| 168 | 168 | { |
| 169 | 169 | $this->ensureDirectoryExists($this->directory, $this->create); |
| 170 | 170 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $directory = preg_replace('/^[\/]*([^\/].*)$/', '/$1', $directory); |
| 212 | 212 | |
| 213 | 213 | $items = $this->parseRawlist( |
| 214 | - ftp_rawlist($this->getConnection(), '-al ' . $this->directory . $directory) ?: [] |
|
| 214 | + ftp_rawlist($this->getConnection(), '-al '.$this->directory.$directory) ?: [] |
|
| 215 | 215 | ); |
| 216 | 216 | |
| 217 | 217 | $fileData = $dirs = []; |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | $item = [ |
| 224 | 224 | 'name' => $itemData['name'], |
| 225 | - 'path' => trim(($directory ? $directory . '/' : '') . $itemData['name'], '/'), |
|
| 225 | + 'path' => trim(($directory ? $directory.'/' : '').$itemData['name'], '/'), |
|
| 226 | 226 | 'time' => $itemData['time'], |
| 227 | 227 | 'size' => $itemData['size'], |
| 228 | 228 | ]; |
@@ -351,13 +351,13 @@ discard block |
||
| 351 | 351 | { |
| 352 | 352 | $directory = preg_replace('/^[\/]*([^\/].*)$/', '/$1', $directory); |
| 353 | 353 | |
| 354 | - $lines = ftp_rawlist($this->getConnection(), '-alR ' . $this->directory . $directory); |
|
| 354 | + $lines = ftp_rawlist($this->getConnection(), '-alR '.$this->directory.$directory); |
|
| 355 | 355 | |
| 356 | 356 | if (false === $lines) { |
| 357 | 357 | return ['keys' => [], 'dirs' => []]; |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | - $regexDir = '/' . preg_quote($this->directory . $directory, '/') . '\/?(.+):$/u'; |
|
| 360 | + $regexDir = '/'.preg_quote($this->directory.$directory, '/').'\/?(.+):$/u'; |
|
| 361 | 361 | $regexItem = '/^(?:([d\-\d])\S+)\s+\S+(?:(?:\s+\S+){5})?\s+(\S+)\s+(.+?)$/'; |
| 362 | 362 | |
| 363 | 363 | $prevLine = null; |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | continue; |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | - $path = ltrim($directory . '/' . $name, '/'); |
|
| 384 | + $path = ltrim($directory.'/'.$name, '/'); |
|
| 385 | 385 | |
| 386 | 386 | if ('d' === $tokens[1] || '<dir>' === $tokens[2]) { |
| 387 | 387 | $keys['dirs'][] = $path; |
@@ -421,13 +421,13 @@ discard block |
||
| 421 | 421 | $infos = preg_split("/[\s]+/", $line, 9); |
| 422 | 422 | |
| 423 | 423 | if ($this->isLinuxListing($infos)) { |
| 424 | - $infos[7] = (strrpos($infos[7], ':') != 2) ? ($infos[7] . ' 00:00') : (date('Y') . ' ' . $infos[7]); |
|
| 424 | + $infos[7] = (strrpos($infos[7], ':') != 2) ? ($infos[7].' 00:00') : (date('Y').' '.$infos[7]); |
|
| 425 | 425 | if ('total' !== $infos[0]) { |
| 426 | 426 | $parsed[] = [ |
| 427 | 427 | 'perms' => $infos[0], |
| 428 | 428 | 'num' => $infos[1], |
| 429 | 429 | 'size' => $infos[4], |
| 430 | - 'time' => strtotime($infos[5] . ' ' . $infos[6] . '. ' . $infos[7]), |
|
| 430 | + 'time' => strtotime($infos[5].' '.$infos[6].'. '.$infos[7]), |
|
| 431 | 431 | 'name' => $infos[8], |
| 432 | 432 | ]; |
| 433 | 433 | } |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | 'perms' => $isDir ? 'd' : '-', |
| 438 | 438 | 'num' => '', |
| 439 | 439 | 'size' => $isDir ? '' : $infos[2], |
| 440 | - 'time' => strtotime($infos[0] . ' ' . $infos[1]), |
|
| 440 | + 'time' => strtotime($infos[0].' '.$infos[1]), |
|
| 441 | 441 | 'name' => $infos[3], |
| 442 | 442 | ]; |
| 443 | 443 | } |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | */ |
| 452 | 452 | private function computePath(string $key): string |
| 453 | 453 | { |
| 454 | - return rtrim($this->directory, '/') . '/' . $key; |
|
| 454 | + return rtrim($this->directory, '/').'/'.$key; |
|
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | /** |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | /** |
| 562 | 562 | * @param array<int, string>|false $info |
| 563 | 563 | */ |
| 564 | - private function isLinuxListing(bool|array $info): bool |
|
| 564 | + private function isLinuxListing(bool | array $info): bool |
|
| 565 | 565 | { |
| 566 | 566 | return count($info) >= 9; |
| 567 | 567 | } |
@@ -22,6 +22,6 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public static function fromFile(string $filename): string |
| 24 | 24 | { |
| 25 | - return md5_file($filename)?: ''; |
|
| 25 | + return md5_file($filename) ?: ''; |
|
| 26 | 26 | } |
| 27 | 27 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public static function fromFile(string $filename): int |
| 28 | 28 | { |
| 29 | - return filesize($filename)?: 0; |
|
| 29 | + return filesize($filename) ?: 0; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -15,14 +15,14 @@ discard block |
||
| 15 | 15 | * |
| 16 | 16 | * @return string|false Returns FALSE in content is not readable |
| 17 | 17 | */ |
| 18 | - public function read(string $key): string|bool; |
|
| 18 | + public function read(string $key): string | bool; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * Writes the given content into the file. |
| 22 | 22 | * |
| 23 | 23 | * @return int|bool The number of bytes that were written into the file |
| 24 | 24 | */ |
| 25 | - public function write(string $key, mixed $content): int|bool; |
|
| 25 | + public function write(string $key, mixed $content): int | bool; |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * Indicates whether the file exists. |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @return int|bool An UNIX like timestamp or false |
| 43 | 43 | */ |
| 44 | - public function mtime(string $key): int|bool; |
|
| 44 | + public function mtime(string $key): int | bool; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Deletes the file. |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | return true; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - public function read(int $count): string|bool |
|
| 53 | + public function read(int $count): string | bool |
|
| 54 | 54 | { |
| 55 | 55 | if (!$this->fileHandle) { |
| 56 | 56 | return false; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | throw new \LogicException('The stream does not allow write.'); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - return fwrite($this->fileHandle, $data)?: 0; |
|
| 76 | + return fwrite($this->fileHandle, $data) ?: 0; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | public function close(): void |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | /** |
| 130 | 130 | * @return array<string, mixed>|false |
| 131 | 131 | */ |
| 132 | - public function stat(): array|bool |
|
| 132 | + public function stat(): array | bool |
|
| 133 | 133 | { |
| 134 | 134 | if ($this->fileHandle) { |
| 135 | 135 | return fstat($this->fileHandle); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | return true; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - public function read(int $count): string|bool |
|
| 57 | + public function read(int $count): string | bool |
|
| 58 | 58 | { |
| 59 | 59 | if (false === $this->mode->allowsRead()) { |
| 60 | 60 | throw new \LogicException('The stream does not allow read.'); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } else { |
| 87 | 87 | $before = substr($this->content, 0, $this->position); |
| 88 | 88 | $after = $newNumBytes > $newPosition ? substr($this->content, $newPosition) : ''; |
| 89 | - $this->content = $before . $data . $after; |
|
| 89 | + $this->content = $before.$data.$after; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $this->position = $newPosition; |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | /** |
| 154 | 154 | * @return array<string, mixed>|false |
| 155 | 155 | */ |
| 156 | - public function stat(): array|bool |
|
| 156 | + public function stat(): array | bool |
|
| 157 | 157 | { |
| 158 | 158 | if ($this->filesystem->has($this->key)) { |
| 159 | 159 | $isDirectory = $this->filesystem->isDirectory($this->key); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | /** |
| 95 | 95 | * @return string|false |
| 96 | 96 | */ |
| 97 | - public function stream_read(int $count): string|bool |
|
| 97 | + public function stream_read(int $count): string | bool |
|
| 98 | 98 | { |
| 99 | 99 | if (isset($this->stream)) { |
| 100 | 100 | return $this->stream->read($count); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | /** |
| 165 | 165 | * @return array<string, mixed>|false |
| 166 | 166 | */ |
| 167 | - public function stream_stat(): array|bool |
|
| 167 | + public function stream_stat(): array | bool |
|
| 168 | 168 | { |
| 169 | 169 | if (isset($this->stream)) { |
| 170 | 170 | return $this->stream->stat(); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | * |
| 179 | 179 | * @TODO handle $flags parameter |
| 180 | 180 | */ |
| 181 | - public function url_stat(string $path, int $flags): array|bool |
|
| 181 | + public function url_stat(string $path, int $flags): array | bool |
|
| 182 | 182 | { |
| 183 | 183 | $stream = $this->createStream($path); |
| 184 | 184 | |
@@ -233,11 +233,11 @@ discard block |
||
| 233 | 233 | $key = !empty($parts['path']) ? substr($parts['path'], 1) : ''; |
| 234 | 234 | |
| 235 | 235 | if (null !== $parts['query']) { |
| 236 | - $key .= '?' . $parts['query']; |
|
| 236 | + $key .= '?'.$parts['query']; |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | if (null !== $parts['fragment']) { |
| 240 | - $key .= '#' . $parts['fragment']; |
|
| 240 | + $key .= '#'.$parts['fragment']; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | if (empty($domain) || empty($key)) { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * {@inheritdoc} |
| 30 | 30 | */ |
| 31 | - public function read(string $key): string|bool |
|
| 31 | + public function read(string $key): string | bool |
|
| 32 | 32 | { |
| 33 | 33 | if (false === ($content = $this->zipArchive->getFromName($key, 0))) { |
| 34 | 34 | return false; |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | /** |
| 41 | 41 | * {@inheritdoc} |
| 42 | 42 | */ |
| 43 | - public function write(string $key, mixed $content): int|bool |
|
| 43 | + public function write(string $key, mixed $content): int | bool |
|
| 44 | 44 | { |
| 45 | 45 | if (!$this->zipArchive->addFromString($key, $content)) { |
| 46 | 46 | return false; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * {@inheritdoc} |
| 90 | 90 | */ |
| 91 | - public function mtime(string $key): int|bool |
|
| 91 | + public function mtime(string $key): int | bool |
|
| 92 | 92 | { |
| 93 | 93 | $stat = $this->getStat($key); |
| 94 | 94 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | /** |
| 77 | 77 | * {@inheritdoc} |
| 78 | 78 | */ |
| 79 | - public function mtime(string $key): int|bool |
|
| 79 | + public function mtime(string $key): int | bool |
|
| 80 | 80 | { |
| 81 | 81 | return $this->getColumnValue($key, 'mtime'); |
| 82 | 82 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * {@inheritdoc} |
| 86 | 86 | */ |
| 87 | - public function checksum(string $key): string|bool |
|
| 87 | + public function checksum(string $key): string | bool |
|
| 88 | 88 | { |
| 89 | 89 | return $this->getColumnValue($key, 'checksum'); |
| 90 | 90 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | /** |
| 114 | 114 | * {@inheritdoc} |
| 115 | 115 | */ |
| 116 | - public function read(string $key): string|bool |
|
| 116 | + public function read(string $key): string | bool |
|
| 117 | 117 | { |
| 118 | 118 | return $this->getColumnValue($key, 'content'); |
| 119 | 119 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | /** |
| 133 | 133 | * {@inheritdoc} |
| 134 | 134 | */ |
| 135 | - public function write(string $key, mixed $content): int|bool |
|
| 135 | + public function write(string $key, mixed $content): int | bool |
|
| 136 | 136 | { |
| 137 | 137 | $values = [ |
| 138 | 138 | $this->getQuotedColumn('content') => $content, |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | return [ |
| 211 | 211 | 'dirs' => [], |
| 212 | 212 | 'keys' => array_map( |
| 213 | - function ($value) { |
|
| 213 | + function($value) { |
|
| 214 | 214 | return $value['_key']; |
| 215 | 215 | }, |
| 216 | 216 | $keys |