@@ -167,12 +167,12 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | $user = $params['user']; |
| 170 | - $this->id = 'swift::' . $user . md5($params['bucket']); |
|
| 170 | + $this->id = 'swift::'.$user.md5($params['bucket']); |
|
| 171 | 171 | |
| 172 | 172 | $bucketUrl = new Uri($params['bucket']); |
| 173 | 173 | if ($bucketUrl->getHost()) { |
| 174 | 174 | $params['bucket'] = basename($bucketUrl->getPath()); |
| 175 | - $params['endpoint_url'] = (string)$bucketUrl->withPath(dirname($bucketUrl->getPath())); |
|
| 175 | + $params['endpoint_url'] = (string) $bucketUrl->withPath(dirname($bucketUrl->getPath())); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | if (empty($params['url'])) { |
@@ -261,16 +261,16 @@ discard block |
||
| 261 | 261 | continue; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | - if ($this->is_dir($path . '/' . $file)) { |
|
| 265 | - $this->rmdir($path . '/' . $file); |
|
| 264 | + if ($this->is_dir($path.'/'.$file)) { |
|
| 265 | + $this->rmdir($path.'/'.$file); |
|
| 266 | 266 | } else { |
| 267 | - $this->unlink($path . '/' . $file); |
|
| 267 | + $this->unlink($path.'/'.$file); |
|
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | try { |
| 272 | - $this->objectStore->deleteObject($path . '/'); |
|
| 273 | - $this->objectCache->remove($path . '/'); |
|
| 272 | + $this->objectStore->deleteObject($path.'/'); |
|
| 273 | + $this->objectCache->remove($path.'/'); |
|
| 274 | 274 | } catch (BadResponseError $e) { |
| 275 | 275 | \OC::$server->getLogger()->logException($e, [ |
| 276 | 276 | 'level' => ILogger::ERROR, |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | $stat = []; |
| 355 | - $stat['size'] = (int)$object->contentLength; |
|
| 355 | + $stat['size'] = (int) $object->contentLength; |
|
| 356 | 356 | $stat['mtime'] = $mtime; |
| 357 | 357 | $stat['atime'] = time(); |
| 358 | 358 | return $stat; |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | try { |
| 385 | 385 | $this->objectStore->deleteObject($path); |
| 386 | 386 | $this->objectCache->remove($path); |
| 387 | - $this->objectCache->remove($path . '/'); |
|
| 387 | + $this->objectCache->remove($path.'/'); |
|
| 388 | 388 | } catch (BadResponseError $e) { |
| 389 | 389 | if ($e->getResponse()->getStatusCode() !== 404) { |
| 390 | 390 | \OC::$server->getLogger()->logException($e, [ |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | file_put_contents($tmpFile, $source); |
| 443 | 443 | } |
| 444 | 444 | $handle = fopen($tmpFile, $mode); |
| 445 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
| 445 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
| 446 | 446 | $this->writeBack($tmpFile, $path); |
| 447 | 447 | }); |
| 448 | 448 | } |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | if (is_null($mtime)) { |
| 454 | 454 | $mtime = time(); |
| 455 | 455 | } |
| 456 | - $metadata = ['timestamp' => (string)$mtime]; |
|
| 456 | + $metadata = ['timestamp' => (string) $mtime]; |
|
| 457 | 457 | if ($this->file_exists($path)) { |
| 458 | 458 | if ($this->is_dir($path) && $path !== '.') { |
| 459 | 459 | $path .= '/'; |
@@ -492,11 +492,11 @@ discard block |
||
| 492 | 492 | try { |
| 493 | 493 | $source = $this->fetchObject($path1); |
| 494 | 494 | $source->copy([ |
| 495 | - 'destination' => $this->bucket . '/' . $path2 |
|
| 495 | + 'destination' => $this->bucket.'/'.$path2 |
|
| 496 | 496 | ]); |
| 497 | 497 | // invalidate target object to force repopulation on fetch |
| 498 | 498 | $this->objectCache->remove($path2); |
| 499 | - $this->objectCache->remove($path2 . '/'); |
|
| 499 | + $this->objectCache->remove($path2.'/'); |
|
| 500 | 500 | } catch (BadResponseError $e) { |
| 501 | 501 | \OC::$server->getLogger()->logException($e, [ |
| 502 | 502 | 'level' => ILogger::ERROR, |
@@ -506,13 +506,13 @@ discard block |
||
| 506 | 506 | } |
| 507 | 507 | } elseif ($fileType === 'dir') { |
| 508 | 508 | try { |
| 509 | - $source = $this->fetchObject($path1 . '/'); |
|
| 509 | + $source = $this->fetchObject($path1.'/'); |
|
| 510 | 510 | $source->copy([ |
| 511 | - 'destination' => $this->bucket . '/' . $path2 . '/' |
|
| 511 | + 'destination' => $this->bucket.'/'.$path2.'/' |
|
| 512 | 512 | ]); |
| 513 | 513 | // invalidate target object to force repopulation on fetch |
| 514 | 514 | $this->objectCache->remove($path2); |
| 515 | - $this->objectCache->remove($path2 . '/'); |
|
| 515 | + $this->objectCache->remove($path2.'/'); |
|
| 516 | 516 | } catch (BadResponseError $e) { |
| 517 | 517 | \OC::$server->getLogger()->logException($e, [ |
| 518 | 518 | 'level' => ILogger::ERROR, |
@@ -527,8 +527,8 @@ discard block |
||
| 527 | 527 | continue; |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | - $source = $path1 . '/' . $file; |
|
| 531 | - $target = $path2 . '/' . $file; |
|
| 530 | + $source = $path1.'/'.$file; |
|
| 531 | + $target = $path2.'/'.$file; |
|
| 532 | 532 | $this->copy($source, $target); |
| 533 | 533 | } |
| 534 | 534 | } else { |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | $path = ''; |
| 609 | 609 | } |
| 610 | 610 | $cachedContent = $this->getCache()->getFolderContents($path); |
| 611 | - $cachedNames = array_map(function ($content) { |
|
| 611 | + $cachedNames = array_map(function($content) { |
|
| 612 | 612 | return $content['name']; |
| 613 | 613 | }, $cachedContent); |
| 614 | 614 | sort($cachedNames); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | protected function checkPlaceholder(): void { |
| 65 | 65 | $this->sanitizedPlaceholder = trim(strtolower($this->placeholder)); |
| 66 | - if (!(bool)\preg_match('/^[a-z0-9]*$/', $this->sanitizedPlaceholder)) { |
|
| 66 | + if (!(bool) \preg_match('/^[a-z0-9]*$/', $this->sanitizedPlaceholder)) { |
|
| 67 | 67 | throw new \RuntimeException(sprintf( |
| 68 | 68 | 'Invalid placeholder %s, only [a-z0-9] are allowed', $this->sanitizedPlaceholder |
| 69 | 69 | )); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | protected function substituteIfString($value, string $replacement) { |
| 82 | 82 | if (is_string($value)) { |
| 83 | - return str_ireplace('$' . $this->sanitizedPlaceholder, $replacement, $value); |
|
| 83 | + return str_ireplace('$'.$this->sanitizedPlaceholder, $replacement, $value); |
|
| 84 | 84 | } |
| 85 | 85 | return $value; |
| 86 | 86 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | * @return Backend[] |
| 217 | 217 | */ |
| 218 | 218 | public function getAvailableBackends() { |
| 219 | - return array_filter($this->getBackends(), function ($backend) { |
|
| 219 | + return array_filter($this->getBackends(), function($backend) { |
|
| 220 | 220 | return !$backend->checkDependencies(); |
| 221 | 221 | }); |
| 222 | 222 | } |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | * @return AuthMechanism[] |
| 256 | 256 | */ |
| 257 | 257 | public function getAuthMechanismsByScheme(array $schemes) { |
| 258 | - return array_filter($this->getAuthMechanisms(), function ($authMech) use ($schemes) { |
|
| 258 | + return array_filter($this->getAuthMechanisms(), function($authMech) use ($schemes) { |
|
| 259 | 259 | return in_array($authMech->getScheme(), $schemes, true); |
| 260 | 260 | }); |
| 261 | 261 | } |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | */ |
| 323 | 323 | public function registerConfigHandler(string $placeholder, callable $configHandlerLoader) { |
| 324 | 324 | $placeholder = trim(strtolower($placeholder)); |
| 325 | - if (!(bool)\preg_match('/^[a-z0-9]*$/', $placeholder)) { |
|
| 325 | + if (!(bool) \preg_match('/^[a-z0-9]*$/', $placeholder)) { |
|
| 326 | 326 | throw new \RuntimeException(sprintf( |
| 327 | 327 | 'Invalid placeholder %s, only [a-z0-9] are allowed', $placeholder |
| 328 | 328 | )); |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | if ($newLoaded) { |
| 354 | 354 | // ensure those with longest placeholders come first, |
| 355 | 355 | // to avoid substring matches |
| 356 | - uksort($this->configHandlers, function ($phA, $phB) { |
|
| 356 | + uksort($this->configHandlers, function($phA, $phB) { |
|
| 357 | 357 | return strlen($phB) <=> strlen($phA); |
| 358 | 358 | }); |
| 359 | 359 | } |
@@ -60,11 +60,11 @@ |
||
| 60 | 60 | // at least on PHP 5.6 usort turned out to be not stable. So we add |
| 61 | 61 | // the current index to the value and compare it on a draw |
| 62 | 62 | $i = 0; |
| 63 | - $workArray = array_map(function ($element) use (&$i) { |
|
| 63 | + $workArray = array_map(function($element) use (&$i) { |
|
| 64 | 64 | return [$i++, $element]; |
| 65 | 65 | }, $byType); |
| 66 | 66 | |
| 67 | - usort($workArray, function ($a, $b) use ($commenters, $type) { |
|
| 67 | + usort($workArray, function($a, $b) use ($commenters, $type) { |
|
| 68 | 68 | $r = $this->compare($a[1], $b[1], $commenters[$type]); |
| 69 | 69 | if ($r === 0) { |
| 70 | 70 | $r = $a[0] - $b[0]; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | return new NotFoundResponse(); |
| 113 | 113 | } |
| 114 | 114 | $userFolder = $this->rootFolder->getUserFolder($currentUser->getUID()); |
| 115 | - $files = $userFolder->getById((int)$comment->getObjectId()); |
|
| 115 | + $files = $userFolder->getById((int) $comment->getObjectId()); |
|
| 116 | 116 | |
| 117 | 117 | $this->markProcessed($comment, $currentUser); |
| 118 | 118 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | $url = $this->urlGenerator->linkToRouteAbsolute( |
| 124 | 124 | 'files.viewcontroller.showFile', |
| 125 | - [ 'fileid' => $comment->getObjectId() ] |
|
| 125 | + ['fileid' => $comment->getObjectId()] |
|
| 126 | 126 | ); |
| 127 | 127 | |
| 128 | 128 | return new RedirectResponse($url); |
@@ -75,10 +75,10 @@ |
||
| 75 | 75 | Request::USER_AGENT_ANDROID_MOBILE_CHROME, |
| 76 | 76 | Request::USER_AGENT_FREEBOX, |
| 77 | 77 | ])) { |
| 78 | - $response->addHeader('Content-Disposition', 'attachment; filename="' . rawurlencode($filename) . '"'); |
|
| 78 | + $response->addHeader('Content-Disposition', 'attachment; filename="'.rawurlencode($filename).'"'); |
|
| 79 | 79 | } else { |
| 80 | - $response->addHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\'' . rawurlencode($filename) |
|
| 81 | - . '; filename="' . rawurlencode($filename) . '"'); |
|
| 80 | + $response->addHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\''.rawurlencode($filename) |
|
| 81 | + . '; filename="'.rawurlencode($filename).'"'); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -45,15 +45,15 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | */ |
| 47 | 47 | public function run($arguments) { |
| 48 | - $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); |
|
| 48 | + $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data'); |
|
| 49 | 49 | $instanceId = $this->config->getSystemValue('instanceid', null); |
| 50 | 50 | |
| 51 | 51 | if (!is_string($instanceId) || empty($instanceId)) { |
| 52 | 52 | return; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $updaterFolderPath = $dataDir . '/updater-' . $instanceId; |
|
| 56 | - $backupFolderPath = $updaterFolderPath . '/backups'; |
|
| 55 | + $updaterFolderPath = $dataDir.'/updater-'.$instanceId; |
|
| 56 | + $backupFolderPath = $updaterFolderPath.'/backups'; |
|
| 57 | 57 | if (file_exists($backupFolderPath)) { |
| 58 | 58 | $this->log->info("$backupFolderPath exists - start to clean it up"); |
| 59 | 59 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | ksort($dirList); |
| 79 | 79 | // drop the newest 3 directories |
| 80 | 80 | $dirList = array_slice($dirList, 0, -3); |
| 81 | - $this->log->info("List of all directories that will be deleted: " . json_encode($dirList)); |
|
| 81 | + $this->log->info("List of all directories that will be deleted: ".json_encode($dirList)); |
|
| 82 | 82 | |
| 83 | 83 | foreach ($dirList as $dir) { |
| 84 | 84 | $this->log->info("Removing $dir ..."); |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | require_once '../../lib/base.php'; |
| 8 | 8 | |
| 9 | 9 | $urlGenerator = \OC::$server->getURLGenerator(); |
| 10 | - header('Location: ' . $urlGenerator->getAbsoluteURL('/')); |
|
| 10 | + header('Location: '.$urlGenerator->getAbsoluteURL('/')); |
|
| 11 | 11 | exit; |
| 12 | 12 | } |
| 13 | 13 | // @codeCoverageIgnoreEnd |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | <?php emit_script_loading_tags($_); ?> |
| 24 | 24 | <?php print_unescaped($_['headers']); ?> |
| 25 | 25 | </head> |
| 26 | - <body id="<?php p($_['bodyid']);?>"> |
|
| 26 | + <body id="<?php p($_['bodyid']); ?>"> |
|
| 27 | 27 | <?php include 'layout.noscript.warning.php'; ?> |
| 28 | 28 | <?php foreach ($_['initialStates'] as $app => $initialState) { ?> |
| 29 | 29 | <input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>"> |