@@ -65,13 +65,13 @@ |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | if (isset($params['root'])) { |
68 | - $root = '/' . ltrim($params['root'], '/'); |
|
68 | + $root = '/'.ltrim($params['root'], '/'); |
|
69 | 69 | } else { |
70 | 70 | $root = '/'; |
71 | 71 | } |
72 | 72 | |
73 | 73 | $params['host'] = $host; |
74 | - $params['root'] = $contextPath . self::OC_URL_SUFFIX . $root; |
|
74 | + $params['root'] = $contextPath.self::OC_URL_SUFFIX.$root; |
|
75 | 75 | $params['authType'] = Client::AUTH_BASIC; |
76 | 76 | |
77 | 77 | parent::__construct($params); |
@@ -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 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $stmt->closeCursor(); |
141 | 141 | |
142 | 142 | foreach ($result as $row) { |
143 | - if ((int)$row['count'] > 1) { |
|
143 | + if ((int) $row['count'] > 1) { |
|
144 | 144 | $this->removeApplicable($row['mount_id'], $applicableType, $applicableId); |
145 | 145 | } else { |
146 | 146 | $this->removeMount($row['mount_id']); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | */ |
218 | 218 | public function getAdminMountsForMultiple($type, array $values) { |
219 | 219 | $builder = $this->connection->getQueryBuilder(); |
220 | - $params = array_map(function ($value) use ($builder) { |
|
220 | + $params = array_map(function($value) use ($builder) { |
|
221 | 221 | return $builder->createNamedParameter($value, IQueryBuilder::PARAM_STR); |
222 | 222 | }, $values); |
223 | 223 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | 'type' => $builder->createNamedParameter($type, IQueryBuilder::PARAM_INT) |
272 | 272 | ]); |
273 | 273 | $query->execute(); |
274 | - return (int)$this->connection->lastInsertId('*PREFIX*external_mounts'); |
|
274 | + return (int) $this->connection->lastInsertId('*PREFIX*external_mounts'); |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | /** |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | } |
417 | 417 | $uniqueMounts = array_values($uniqueMounts); |
418 | 418 | |
419 | - $mountIds = array_map(function ($mount) { |
|
419 | + $mountIds = array_map(function($mount) { |
|
420 | 420 | return $mount['mount_id']; |
421 | 421 | }, $uniqueMounts); |
422 | 422 | $mountIds = array_values(array_unique($mountIds)); |
@@ -425,9 +425,9 @@ discard block |
||
425 | 425 | $config = $this->getConfigForMounts($mountIds); |
426 | 426 | $options = $this->getOptionsForMounts($mountIds); |
427 | 427 | |
428 | - return array_map(function ($mount, $applicable, $config, $options) { |
|
429 | - $mount['type'] = (int)$mount['type']; |
|
430 | - $mount['priority'] = (int)$mount['priority']; |
|
428 | + return array_map(function($mount, $applicable, $config, $options) { |
|
429 | + $mount['type'] = (int) $mount['type']; |
|
430 | + $mount['priority'] = (int) $mount['priority']; |
|
431 | 431 | $mount['applicable'] = $applicable; |
432 | 432 | $mount['config'] = $config; |
433 | 433 | $mount['options'] = $options; |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | } |
450 | 450 | $builder = $this->connection->getQueryBuilder(); |
451 | 451 | $fields[] = 'mount_id'; |
452 | - $placeHolders = array_map(function ($id) use ($builder) { |
|
452 | + $placeHolders = array_map(function($id) use ($builder) { |
|
453 | 453 | return $builder->createPositionalParameter($id, IQueryBuilder::PARAM_INT); |
454 | 454 | }, $mountIds); |
455 | 455 | $query = $builder->select($fields) |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | } |
464 | 464 | foreach ($rows as $row) { |
465 | 465 | if (isset($row['type'])) { |
466 | - $row['type'] = (int)$row['type']; |
|
466 | + $row['type'] = (int) $row['type']; |
|
467 | 467 | } |
468 | 468 | $result[$row['mount_id']][] = $row; |
469 | 469 | } |
@@ -494,8 +494,8 @@ discard block |
||
494 | 494 | public function getOptionsForMounts($mountIds) { |
495 | 495 | $mountOptions = $this->selectForMounts('external_options', ['key', 'value'], $mountIds); |
496 | 496 | $optionsMap = array_map([$this, 'createKeyValueMap'], $mountOptions); |
497 | - return array_map(function (array $options) { |
|
498 | - return array_map(function ($option) { |
|
497 | + return array_map(function(array $options) { |
|
498 | + return array_map(function($option) { |
|
499 | 499 | return json_decode($option); |
500 | 500 | }, $options); |
501 | 501 | }, $optionsMap); |
@@ -506,16 +506,16 @@ discard block |
||
506 | 506 | * @return array ['key1' => $value1, ...] |
507 | 507 | */ |
508 | 508 | private function createKeyValueMap(array $keyValuePairs) { |
509 | - $decryptedPairts = array_map(function ($pair) { |
|
509 | + $decryptedPairts = array_map(function($pair) { |
|
510 | 510 | if ($pair['key'] === 'password') { |
511 | 511 | $pair['value'] = $this->decryptValue($pair['value']); |
512 | 512 | } |
513 | 513 | return $pair; |
514 | 514 | }, $keyValuePairs); |
515 | - $keys = array_map(function ($pair) { |
|
515 | + $keys = array_map(function($pair) { |
|
516 | 516 | return $pair['key']; |
517 | 517 | }, $decryptedPairts); |
518 | - $values = array_map(function ($pair) { |
|
518 | + $values = array_map(function($pair) { |
|
519 | 519 | return $pair['value']; |
520 | 520 | }, $decryptedPairts); |
521 | 521 |
@@ -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 | } |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | <h2><?php p($l->t('No external storage configured or you don\'t have the permission to configure them')); ?></h2> |
101 | 101 | </div> |
102 | 102 | |
103 | -<form data-can-create="<?php echo $canCreateMounts?'true':'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>"> |
|
103 | +<form data-can-create="<?php echo $canCreateMounts ? 'true' : 'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled'] ? 'true' : 'false'; ?>"> |
|
104 | 104 | <h2 class="inlineblock" data-anchor-name="external-storage"><?php p($l->t('External storages')); ?></h2> |
105 | - <a target="_blank" rel="noreferrer" class="icon-info" title="<?php p($l->t('Open documentation'));?>" href="<?php p(link_to_docs('admin-external-storage')); ?>"></a> |
|
105 | + <a target="_blank" rel="noreferrer" class="icon-info" title="<?php p($l->t('Open documentation')); ?>" href="<?php p(link_to_docs('admin-external-storage')); ?>"></a> |
|
106 | 106 | <p class="settings-hint"><?php p($l->t('External storage enables you to mount external storage services and devices as secondary Nextcloud storage devices. You may also allow users to mount their own external storage services.')); ?></p> |
107 | 107 | <?php if (isset($_['dependencies']) and ($_['dependencies'] !== '') and $canCreateMounts) { |
108 | 108 | print_unescaped(''.$_['dependencies'].''); |
@@ -142,10 +142,10 @@ discard block |
||
142 | 142 | <?php p($l->t('Add storage')); ?> |
143 | 143 | </option> |
144 | 144 | <?php |
145 | - $sortedBackends = array_filter($_['backends'], function ($backend) use ($_) { |
|
145 | + $sortedBackends = array_filter($_['backends'], function($backend) use ($_) { |
|
146 | 146 | return $backend->isVisibleFor($_['visibilityType']); |
147 | 147 | }); |
148 | - uasort($sortedBackends, function ($a, $b) { |
|
148 | + uasort($sortedBackends, function($a, $b) { |
|
149 | 149 | return strcasecmp($a->getText(), $b->getText()); |
150 | 150 | }); |
151 | 151 | ?> |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | <p id="userMountingBackends"<?php if (!$_['allowUserMounting']): ?> class="hidden"<?php endif; ?>> |
186 | 186 | <?php |
187 | - $userBackends = array_filter($_['backends'], function ($backend) { |
|
187 | + $userBackends = array_filter($_['backends'], function($backend) { |
|
188 | 188 | return $backend->isAllowedVisibleFor(BackendService::VISIBILITY_PERSONAL); |
189 | 189 | }); |
190 | 190 | ?> |
@@ -52,7 +52,7 @@ |
||
52 | 52 | public function generateToken() { |
53 | 53 | $token = $this->secureRandom->generate( |
54 | 54 | self::TOKEN_LENGTH, |
55 | - ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS); |
|
55 | + ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS); |
|
56 | 56 | return $token; |
57 | 57 | } |
58 | 58 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $owner = isset($_POST['owner']) ? $_POST['owner'] : null; |
143 | 143 | $sharedBy = isset($_POST['sharedBy']) ? $_POST['sharedBy'] : null; |
144 | 144 | $shareWith = isset($_POST['shareWith']) ? $_POST['shareWith'] : null; |
145 | - $remoteId = isset($_POST['remoteId']) ? (int)$_POST['remoteId'] : null; |
|
145 | + $remoteId = isset($_POST['remoteId']) ? (int) $_POST['remoteId'] : null; |
|
146 | 146 | $sharedByFederatedId = isset($_POST['sharedByFederatedId']) ? $_POST['sharedByFederatedId'] : null; |
147 | 147 | $ownerFederatedId = isset($_POST['ownerFederatedId']) ? $_POST['ownerFederatedId'] : null; |
148 | 148 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | } catch (ProviderCouldNotAddShareException $e) { |
178 | 178 | throw new OCSException($e->getMessage(), 400); |
179 | 179 | } catch (\Exception $e) { |
180 | - throw new OCSException('internal server error, was not able to add share from ' . $remote, 500); |
|
180 | + throw new OCSException('internal server error, was not able to add share from '.$remote, 500); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | return new Http\DataResponse(); |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | public function reShare($id) { |
199 | 199 | $token = $this->request->getParam('token', null); |
200 | 200 | $shareWith = $this->request->getParam('shareWith', null); |
201 | - $permission = (int)$this->request->getParam('permission', null); |
|
202 | - $remoteId = (int)$this->request->getParam('remoteId', null); |
|
201 | + $permission = (int) $this->request->getParam('permission', null); |
|
202 | + $remoteId = (int) $this->request->getParam('remoteId', null); |
|
203 | 203 | |
204 | 204 | if ($id === null || |
205 | 205 | $token === null || |
@@ -227,9 +227,9 @@ discard block |
||
227 | 227 | } catch (ProviderDoesNotExistsException $e) { |
228 | 228 | throw new OCSException('Server does not support federated cloud sharing', 503); |
229 | 229 | } catch (ShareNotFound $e) { |
230 | - $this->logger->debug('Share not found: ' . $e->getMessage()); |
|
230 | + $this->logger->debug('Share not found: '.$e->getMessage()); |
|
231 | 231 | } catch (\Exception $e) { |
232 | - $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |
|
232 | + $this->logger->debug('internal server error, can not process notification: '.$e->getMessage()); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | throw new OCSBadRequestException(); |
@@ -262,9 +262,9 @@ discard block |
||
262 | 262 | } catch (ProviderDoesNotExistsException $e) { |
263 | 263 | throw new OCSException('Server does not support federated cloud sharing', 503); |
264 | 264 | } catch (ShareNotFound $e) { |
265 | - $this->logger->debug('Share not found: ' . $e->getMessage()); |
|
265 | + $this->logger->debug('Share not found: '.$e->getMessage()); |
|
266 | 266 | } catch (\Exception $e) { |
267 | - $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |
|
267 | + $this->logger->debug('internal server error, can not process notification: '.$e->getMessage()); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | return new Http\DataResponse(); |
@@ -294,9 +294,9 @@ discard block |
||
294 | 294 | } catch (ProviderDoesNotExistsException $e) { |
295 | 295 | throw new OCSException('Server does not support federated cloud sharing', 503); |
296 | 296 | } catch (ShareNotFound $e) { |
297 | - $this->logger->debug('Share not found: ' . $e->getMessage()); |
|
297 | + $this->logger->debug('Share not found: '.$e->getMessage()); |
|
298 | 298 | } catch (\Exception $e) { |
299 | - $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |
|
299 | + $this->logger->debug('internal server error, can not process notification: '.$e->getMessage()); |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | return new Http\DataResponse(); |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | $notification = ['sharedSecret' => $token]; |
325 | 325 | $provider->notificationReceived('SHARE_UNSHARED', $id, $notification); |
326 | 326 | } catch (\Exception $e) { |
327 | - $this->logger->debug('processing unshare notification failed: ' . $e->getMessage()); |
|
327 | + $this->logger->debug('processing unshare notification failed: '.$e->getMessage()); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | return new Http\DataResponse(); |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | |
395 | 395 | try { |
396 | 396 | $provider = $this->cloudFederationProviderManager->getCloudFederationProvider('file'); |
397 | - $ocmPermissions = $this->ncPermissions2ocmPermissions((int)$ncPermissions); |
|
397 | + $ocmPermissions = $this->ncPermissions2ocmPermissions((int) $ncPermissions); |
|
398 | 398 | $notification = ['sharedSecret' => $token, 'permission' => $ocmPermissions]; |
399 | 399 | $provider->notificationReceived('RESHARE_CHANGE_PERMISSION', $id, $notification); |
400 | 400 | } catch (\Exception $e) { |
@@ -87,13 +87,13 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function getThemedIcon(string $app, string $image): Response { |
89 | 89 | try { |
90 | - $iconFile = $this->imageManager->getCachedImage('icon-' . $app . '-' . str_replace('/', '_',$image)); |
|
90 | + $iconFile = $this->imageManager->getCachedImage('icon-'.$app.'-'.str_replace('/', '_', $image)); |
|
91 | 91 | } catch (NotFoundException $exception) { |
92 | 92 | $icon = $this->iconBuilder->colorSvg($app, $image); |
93 | 93 | if ($icon === false || $icon === '') { |
94 | 94 | return new NotFoundResponse(); |
95 | 95 | } |
96 | - $iconFile = $this->imageManager->setCachedImage('icon-' . $app . '-' . str_replace('/', '_',$image), $icon); |
|
96 | + $iconFile = $this->imageManager->setCachedImage('icon-'.$app.'-'.str_replace('/', '_', $image), $icon); |
|
97 | 97 | } |
98 | 98 | if ($iconFile !== false) { |
99 | 99 | $response = new FileDisplayResponse($iconFile, Http::STATUS_OK, ['Content-Type' => 'image/svg+xml']); |
@@ -124,17 +124,17 @@ discard block |
||
124 | 124 | } |
125 | 125 | if ($iconFile === null && $this->imageManager->shouldReplaceIcons()) { |
126 | 126 | try { |
127 | - $iconFile = $this->imageManager->getCachedImage('favIcon-' . $app); |
|
127 | + $iconFile = $this->imageManager->getCachedImage('favIcon-'.$app); |
|
128 | 128 | } catch (NotFoundException $exception) { |
129 | 129 | $icon = $this->iconBuilder->getFavicon($app); |
130 | - $iconFile = $this->imageManager->setCachedImage('favIcon-' . $app, $icon); |
|
130 | + $iconFile = $this->imageManager->setCachedImage('favIcon-'.$app, $icon); |
|
131 | 131 | } |
132 | 132 | if ($iconFile !== false) { |
133 | 133 | $response = new FileDisplayResponse($iconFile, Http::STATUS_OK, ['Content-Type' => 'image/x-icon']); |
134 | 134 | } |
135 | 135 | } |
136 | 136 | if ($response === null) { |
137 | - $fallbackLogo = \OC::$SERVERROOT . '/core/img/favicon.png'; |
|
137 | + $fallbackLogo = \OC::$SERVERROOT.'/core/img/favicon.png'; |
|
138 | 138 | $response = new DataDisplayResponse($this->fileAccessHelper->file_get_contents($fallbackLogo), Http::STATUS_OK, ['Content-Type' => 'image/x-icon']); |
139 | 139 | } |
140 | 140 | $response->cacheFor(86400); |
@@ -160,17 +160,17 @@ discard block |
||
160 | 160 | } |
161 | 161 | if ($this->imageManager->shouldReplaceIcons()) { |
162 | 162 | try { |
163 | - $iconFile = $this->imageManager->getCachedImage('touchIcon-' . $app); |
|
163 | + $iconFile = $this->imageManager->getCachedImage('touchIcon-'.$app); |
|
164 | 164 | } catch (NotFoundException $exception) { |
165 | 165 | $icon = $this->iconBuilder->getTouchIcon($app); |
166 | - $iconFile = $this->imageManager->setCachedImage('touchIcon-' . $app, $icon); |
|
166 | + $iconFile = $this->imageManager->setCachedImage('touchIcon-'.$app, $icon); |
|
167 | 167 | } |
168 | 168 | if ($iconFile !== false) { |
169 | 169 | $response = new FileDisplayResponse($iconFile, Http::STATUS_OK, ['Content-Type' => 'image/png']); |
170 | 170 | } |
171 | 171 | } |
172 | 172 | if ($response === null) { |
173 | - $fallbackLogo = \OC::$SERVERROOT . '/core/img/favicon-touch.png'; |
|
173 | + $fallbackLogo = \OC::$SERVERROOT.'/core/img/favicon-touch.png'; |
|
174 | 174 | $response = new DataDisplayResponse($this->fileAccessHelper->file_get_contents($fallbackLogo), Http::STATUS_OK, ['Content-Type' => 'image/png']); |
175 | 175 | } |
176 | 176 | $response->cacheFor(86400); |