@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | public static function computerFileSize($str) { |
104 | 104 | $str = strtolower($str); |
105 | 105 | if (is_numeric($str)) { |
106 | - return (float)$str; |
|
106 | + return (float) $str; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | $bytes_array = [ |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | 'p' => 1024 * 1024 * 1024 * 1024 * 1024, |
121 | 121 | ]; |
122 | 122 | |
123 | - $bytes = (float)$str; |
|
123 | + $bytes = (float) $str; |
|
124 | 124 | |
125 | 125 | if (preg_match('#([kmgtp]?b?)$#si', $str, $matches) && !empty($bytes_array[$matches[1]])) { |
126 | 126 | $bytes *= $bytes_array[$matches[1]]; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | } |
236 | 236 | foreach ($dirs as $dir) { |
237 | 237 | foreach ($exts as $ext) { |
238 | - if ($check_fn("$dir/$name" . $ext)) { |
|
238 | + if ($check_fn("$dir/$name".$ext)) { |
|
239 | 239 | return true; |
240 | 240 | } |
241 | 241 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | $ext = ''; |
308 | 308 | } |
309 | 309 | |
310 | - $newpath = $path . '/' . $filename; |
|
310 | + $newpath = $path.'/'.$filename; |
|
311 | 311 | if ($view->file_exists($newpath)) { |
312 | 312 | if (preg_match_all('/\((\d+)\)/', $name, $matches, PREG_OFFSET_CAPTURE)) { |
313 | 313 | //Replace the last "(number)" with "(number+1)" |
@@ -323,11 +323,11 @@ discard block |
||
323 | 323 | do { |
324 | 324 | if ($offset) { |
325 | 325 | //Replace the last "(number)" with "(number+1)" |
326 | - $newname = substr_replace($name, '(' . $counter . ')', $offset, $match_length); |
|
326 | + $newname = substr_replace($name, '('.$counter.')', $offset, $match_length); |
|
327 | 327 | } else { |
328 | - $newname = $name . ' (' . $counter . ')'; |
|
328 | + $newname = $name.' ('.$counter.')'; |
|
329 | 329 | } |
330 | - $newpath = $path . '/' . $newname . $ext; |
|
330 | + $newpath = $path.'/'.$newname.$ext; |
|
331 | 331 | $counter++; |
332 | 332 | } while ($view->file_exists($newpath)); |
333 | 333 | } |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | $freeSpace = max($freeSpace, 0); |
409 | 409 | return $freeSpace; |
410 | 410 | } else { |
411 | - return (INF > 0)? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188 |
|
411 | + return (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188 |
|
412 | 412 | } |
413 | 413 | } |
414 | 414 | |
@@ -421,9 +421,9 @@ discard block |
||
421 | 421 | $ini = \OC::$server->get(IniGetWrapper::class); |
422 | 422 | $upload_max_filesize = OCP\Util::computerFileSize($ini->get('upload_max_filesize')); |
423 | 423 | $post_max_size = OCP\Util::computerFileSize($ini->get('post_max_size')); |
424 | - if ((int)$upload_max_filesize === 0 and (int)$post_max_size === 0) { |
|
424 | + if ((int) $upload_max_filesize === 0 and (int) $post_max_size === 0) { |
|
425 | 425 | return INF; |
426 | - } elseif ((int)$upload_max_filesize === 0 or (int)$post_max_size === 0) { |
|
426 | + } elseif ((int) $upload_max_filesize === 0 or (int) $post_max_size === 0) { |
|
427 | 427 | return max($upload_max_filesize, $post_max_size); //only the non 0 value counts |
428 | 428 | } else { |
429 | 429 | return min($upload_max_filesize, $post_max_size); |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | $includeExtStorage = \OC::$server->getSystemConfig()->getValue('quota_include_external_storage', false); |
497 | 497 | |
498 | 498 | $fullPath = Filesystem::getView()->getAbsolutePath($path); |
499 | - $cacheKey = $fullPath. '::' . ($includeMountPoints ? 'include' : 'exclude'); |
|
499 | + $cacheKey = $fullPath.'::'.($includeMountPoints ? 'include' : 'exclude'); |
|
500 | 500 | $cached = $memcache->get($cacheKey); |
501 | 501 | if ($cached) { |
502 | 502 | return $cached; |