@@ -261,9 +261,9 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public static function linkToRemote($service) { |
263 | 263 | $urlGenerator = \OCP\Server::get(IURLGenerator::class); |
264 | - $remoteBase = $urlGenerator->linkTo('', 'remote.php') . '/' . $service; |
|
264 | + $remoteBase = $urlGenerator->linkTo('', 'remote.php').'/'.$service; |
|
265 | 265 | return $urlGenerator->getAbsoluteURL( |
266 | - $remoteBase . (($service[strlen($service) - 1] != '/') ? '/' : '') |
|
266 | + $remoteBase.(($service[strlen($service) - 1] != '/') ? '/' : '') |
|
267 | 267 | ); |
268 | 268 | } |
269 | 269 | |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | $user_part = $config->getSystemValueString('mail_from_address', $user_part); |
304 | 304 | $host_name = self::getServerHostName(); |
305 | 305 | $host_name = $config->getSystemValueString('mail_domain', $host_name); |
306 | - $defaultEmailAddress = $user_part . '@' . $host_name; |
|
306 | + $defaultEmailAddress = $user_part.'@'.$host_name; |
|
307 | 307 | |
308 | 308 | $mailer = \OCP\Server::get(IMailer::class); |
309 | 309 | if ($mailer->validateMailAddress($defaultEmailAddress)) { |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | } |
312 | 312 | |
313 | 313 | // in case we cannot build a valid email address from the hostname let's fallback to 'localhost.localdomain' |
314 | - return $user_part . '@localhost.localdomain'; |
|
314 | + return $user_part.'@localhost.localdomain'; |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | /** |
@@ -320,9 +320,9 @@ discard block |
||
320 | 320 | * @return int|float int if it fits, float if it is too big |
321 | 321 | * @since 26.0.0 |
322 | 322 | */ |
323 | - public static function numericToNumber(string|float|int $number): int|float { |
|
323 | + public static function numericToNumber(string | float | int $number): int | float { |
|
324 | 324 | /* This is a hack to cast to (int|float) */ |
325 | - return 0 + (string)$number; |
|
325 | + return 0 + (string) $number; |
|
326 | 326 | } |
327 | 327 | |
328 | 328 | /** |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | * @return string a human readable file size |
332 | 332 | * @since 4.0.0 |
333 | 333 | */ |
334 | - public static function humanFileSize(int|float $bytes): string { |
|
334 | + public static function humanFileSize(int | float $bytes): string { |
|
335 | 335 | if ($bytes < 0) { |
336 | 336 | return '?'; |
337 | 337 | } |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | * @return false|int|float a file size in bytes |
368 | 368 | * @since 4.0.0 |
369 | 369 | */ |
370 | - public static function computerFileSize(string $str): false|int|float { |
|
370 | + public static function computerFileSize(string $str): false | int | float { |
|
371 | 371 | $str = strtolower($str); |
372 | 372 | if (is_numeric($str)) { |
373 | 373 | return Util::numericToNumber($str); |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | 'p' => 1024 * 1024 * 1024 * 1024 * 1024, |
388 | 388 | ]; |
389 | 389 | |
390 | - $bytes = (float)$str; |
|
390 | + $bytes = (float) $str; |
|
391 | 391 | |
392 | 392 | if (preg_match('#([kmgtp]?b?)$#si', $str, $matches) && isset($bytes_array[$matches[1]])) { |
393 | 393 | $bytes *= $bytes_array[$matches[1]]; |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | * @return int|float number of bytes representing |
533 | 533 | * @since 5.0.0 |
534 | 534 | */ |
535 | - public static function maxUploadFilesize(string $dir, int|float|null $free = null): int|float { |
|
535 | + public static function maxUploadFilesize(string $dir, int | float | null $free = null): int | float { |
|
536 | 536 | if (is_null($free) || $free < 0) { |
537 | 537 | $free = self::freeSpace($dir); |
538 | 538 | } |
@@ -545,13 +545,13 @@ discard block |
||
545 | 545 | * @return int|float number of bytes representing |
546 | 546 | * @since 7.0.0 |
547 | 547 | */ |
548 | - public static function freeSpace(string $dir): int|float { |
|
548 | + public static function freeSpace(string $dir): int | float { |
|
549 | 549 | $freeSpace = \OC\Files\Filesystem::free_space($dir); |
550 | 550 | if ($freeSpace < \OCP\Files\FileInfo::SPACE_UNLIMITED) { |
551 | 551 | $freeSpace = max($freeSpace, 0); |
552 | 552 | return $freeSpace; |
553 | 553 | } else { |
554 | - return (INF > 0)? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188 |
|
554 | + return (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188 |
|
555 | 555 | } |
556 | 556 | } |
557 | 557 | |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | * @return int|float number of bytes representing |
562 | 562 | * @since 7.0.0 |
563 | 563 | */ |
564 | - public static function uploadLimit(): int|float { |
|
564 | + public static function uploadLimit(): int | float { |
|
565 | 565 | $ini = Server::get(IniGetWrapper::class); |
566 | 566 | $upload_max_filesize = self::computerFileSize($ini->get('upload_max_filesize')) ?: 0; |
567 | 567 | $post_max_size = self::computerFileSize($ini->get('post_max_size')) ?: 0; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * |
44 | 44 | * Makes 2048 to 2 kB. |
45 | 45 | */ |
46 | - public static function humanFileSize(int|float $bytes): string { |
|
46 | + public static function humanFileSize(int | float $bytes): string { |
|
47 | 47 | return \OCP\Util::humanFileSize($bytes); |
48 | 48 | } |
49 | 49 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * Inspired by: https://www.php.net/manual/en/function.filesize.php#92418 |
59 | 59 | */ |
60 | - public static function computerFileSize(string $str): false|int|float { |
|
60 | + public static function computerFileSize(string $str): false | int | float { |
|
61 | 61 | return \OCP\Util::computerFileSize($str); |
62 | 62 | } |
63 | 63 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | } |
145 | 145 | foreach ($dirs as $dir) { |
146 | 146 | foreach ($exts as $ext) { |
147 | - if ($check_fn("$dir/$name" . $ext)) { |
|
147 | + if ($check_fn("$dir/$name".$ext)) { |
|
148 | 148 | return true; |
149 | 149 | } |
150 | 150 | } |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $ext = ''; |
217 | 217 | } |
218 | 218 | |
219 | - $newpath = $path . '/' . $filename; |
|
219 | + $newpath = $path.'/'.$filename; |
|
220 | 220 | if ($view->file_exists($newpath)) { |
221 | 221 | if (preg_match_all('/\((\d+)\)/', $name, $matches, PREG_OFFSET_CAPTURE)) { |
222 | 222 | //Replace the last "(number)" with "(number+1)" |
@@ -232,11 +232,11 @@ discard block |
||
232 | 232 | do { |
233 | 233 | if ($offset) { |
234 | 234 | //Replace the last "(number)" with "(number+1)" |
235 | - $newname = substr_replace($name, '(' . $counter . ')', $offset, $match_length); |
|
235 | + $newname = substr_replace($name, '('.$counter.')', $offset, $match_length); |
|
236 | 236 | } else { |
237 | - $newname = $name . ' (' . $counter . ')'; |
|
237 | + $newname = $name.' ('.$counter.')'; |
|
238 | 238 | } |
239 | - $newpath = $path . '/' . $newname . $ext; |
|
239 | + $newpath = $path.'/'.$newname.$ext; |
|
240 | 240 | $counter++; |
241 | 241 | } while ($view->file_exists($newpath)); |
242 | 242 | } |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | } |
355 | 355 | $fullPath = Filesystem::normalizePath($view->getAbsolutePath($path)); |
356 | 356 | |
357 | - $cacheKey = $fullPath . '::' . ($includeMountPoints ? 'include' : 'exclude'); |
|
357 | + $cacheKey = $fullPath.'::'.($includeMountPoints ? 'include' : 'exclude'); |
|
358 | 358 | if ($useCache) { |
359 | 359 | $cached = $memcache->get($cacheKey); |
360 | 360 | if ($cached) { |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | |
466 | 466 | if ($isRemoteShare === false && $ownerId !== false && $path === '/') { |
467 | 467 | // If path is root, store this as last known quota usage for this user |
468 | - \OCP\Server::get(\OCP\IConfig::class)->setUserValue($ownerId, 'files', 'lastSeenQuotaUsage', (string)$relative); |
|
468 | + \OCP\Server::get(\OCP\IConfig::class)->setUserValue($ownerId, 'files', 'lastSeenQuotaUsage', (string) $relative); |
|
469 | 469 | } |
470 | 470 | |
471 | 471 | $memcache->set($cacheKey, $info, 5 * 60); |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | * @psalm-suppress LessSpecificReturnStatement Legacy code outputs weird types - manually validated that they are correct |
480 | 480 | * @return StorageInfo |
481 | 481 | */ |
482 | - private static function getGlobalStorageInfo(int|float $quota, IUser $user, IMountPoint $mount): array { |
|
482 | + private static function getGlobalStorageInfo(int | float $quota, IUser $user, IMountPoint $mount): array { |
|
483 | 483 | $rootInfo = \OC\Files\Filesystem::getFileInfo('', 'ext'); |
484 | 484 | /** @var int|float $used */ |
485 | 485 | $used = $rootInfo['size']; |
@@ -524,9 +524,9 @@ discard block |
||
524 | 524 | /** @var ICacheFactory $cacheFactory */ |
525 | 525 | $cacheFactory = \OC::$server->get(ICacheFactory::class); |
526 | 526 | $memcache = $cacheFactory->createLocal('storage_info'); |
527 | - $cacheKeyPrefix = Filesystem::normalizePath($absolutePath) . '::'; |
|
528 | - $memcache->remove($cacheKeyPrefix . 'include'); |
|
529 | - $memcache->remove($cacheKeyPrefix . 'exclude'); |
|
527 | + $cacheKeyPrefix = Filesystem::normalizePath($absolutePath).'::'; |
|
528 | + $memcache->remove($cacheKeyPrefix.'include'); |
|
529 | + $memcache->remove($cacheKeyPrefix.'exclude'); |
|
530 | 530 | } |
531 | 531 | |
532 | 532 | /** |