@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | if (!$this->isValidPath($path)) { |
| 56 | 56 | throw new NotPermittedException('Invalid path'); |
| 57 | 57 | } |
| 58 | - return $this->path . $this->normalizePath($path); |
|
| 58 | + return $this->path.$this->normalizePath($path); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | if ($path === $this->path) { |
| 70 | 70 | return '/'; |
| 71 | - } else if (strpos($path, $this->path . '/') !== 0) { |
|
| 71 | + } else if (strpos($path, $this->path.'/') !== 0) { |
|
| 72 | 72 | return null; |
| 73 | 73 | } else { |
| 74 | 74 | $path = substr($path, strlen($this->path)); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @return bool |
| 84 | 84 | */ |
| 85 | 85 | public function isSubNode($node) { |
| 86 | - return strpos($node->getPath(), $this->path . '/') === 0; |
|
| 86 | + return strpos($node->getPath(), $this->path.'/') === 0; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | public function getDirectoryListing() { |
| 96 | 96 | $folderContent = $this->view->getDirectoryContent($this->path); |
| 97 | 97 | |
| 98 | - return array_map(function (FileInfo $info) { |
|
| 98 | + return array_map(function(FileInfo $info) { |
|
| 99 | 99 | if ($info->getMimetype() === 'httpd/unix-directory') { |
| 100 | 100 | return new Folder($this->root, $this->view, $info->getPath(), $info); |
| 101 | 101 | } else { |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | public function search($query) { |
| 198 | 198 | if (is_string($query)) { |
| 199 | - return $this->searchCommon('search', array('%' . $query . '%')); |
|
| 199 | + return $this->searchCommon('search', array('%'.$query.'%')); |
|
| 200 | 200 | } else { |
| 201 | 201 | return $this->searchCommon('searchQuery', array($query)); |
| 202 | 202 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $internalPath = $mount->getInternalPath($this->path); |
| 237 | 237 | $internalPath = rtrim($internalPath, '/'); |
| 238 | 238 | if ($internalPath !== '') { |
| 239 | - $internalPath = $internalPath . '/'; |
|
| 239 | + $internalPath = $internalPath.'/'; |
|
| 240 | 240 | } |
| 241 | 241 | $internalRootLength = strlen($internalPath); |
| 242 | 242 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | $result['internalPath'] = $result['path']; |
| 249 | 249 | $result['path'] = substr($result['path'], $internalRootLength); |
| 250 | 250 | $result['storage'] = $storage; |
| 251 | - $files[] = new \OC\Files\FileInfo($this->path . '/' . $result['path'], $storage, $result['internalPath'], $result, $mount); |
|
| 251 | + $files[] = new \OC\Files\FileInfo($this->path.'/'.$result['path'], $storage, $result['internalPath'], $result, $mount); |
|
| 252 | 252 | } |
| 253 | 253 | } |
| 254 | 254 | |
@@ -262,14 +262,14 @@ discard block |
||
| 262 | 262 | $results = call_user_func_array(array($cache, $method), $args); |
| 263 | 263 | foreach ($results as $result) { |
| 264 | 264 | $result['internalPath'] = $result['path']; |
| 265 | - $result['path'] = $relativeMountPoint . $result['path']; |
|
| 265 | + $result['path'] = $relativeMountPoint.$result['path']; |
|
| 266 | 266 | $result['storage'] = $storage; |
| 267 | - $files[] = new \OC\Files\FileInfo($this->path . '/' . $result['path'], $storage, $result['internalPath'], $result, $mount); |
|
| 267 | + $files[] = new \OC\Files\FileInfo($this->path.'/'.$result['path'], $storage, $result['internalPath'], $result, $mount); |
|
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | - return array_map(function (FileInfo $file) { |
|
| 272 | + return array_map(function(FileInfo $file) { |
|
| 273 | 273 | return $this->createNode($file->getPath(), $file); |
| 274 | 274 | }, $files); |
| 275 | 275 | } |
@@ -285,16 +285,16 @@ discard block |
||
| 285 | 285 | } else { |
| 286 | 286 | $user = null; |
| 287 | 287 | } |
| 288 | - $mountsContainingFile = $mountCache->getMountsForFileId((int)$id, $user); |
|
| 288 | + $mountsContainingFile = $mountCache->getMountsForFileId((int) $id, $user); |
|
| 289 | 289 | $mounts = $this->root->getMountsIn($this->path); |
| 290 | 290 | $mounts[] = $this->root->getMount($this->path); |
| 291 | 291 | /** @var IMountPoint[] $folderMounts */ |
| 292 | - $folderMounts = array_combine(array_map(function (IMountPoint $mountPoint) { |
|
| 292 | + $folderMounts = array_combine(array_map(function(IMountPoint $mountPoint) { |
|
| 293 | 293 | return $mountPoint->getMountPoint(); |
| 294 | 294 | }, $mounts), $mounts); |
| 295 | 295 | |
| 296 | 296 | /** @var ICachedMountInfo[] $mountsContainingFile */ |
| 297 | - $mountsContainingFile = array_values(array_filter($mountsContainingFile, function (ICachedMountInfo $cachedMountInfo) use ($folderMounts) { |
|
| 297 | + $mountsContainingFile = array_values(array_filter($mountsContainingFile, function(ICachedMountInfo $cachedMountInfo) use ($folderMounts) { |
|
| 298 | 298 | return isset($folderMounts[$cachedMountInfo->getMountPoint()]); |
| 299 | 299 | })); |
| 300 | 300 | |
@@ -305,25 +305,25 @@ discard block |
||
| 305 | 305 | // we only need to get the cache info once, since all mounts we found point to the same storage |
| 306 | 306 | |
| 307 | 307 | $mount = $folderMounts[$mountsContainingFile[0]->getMountPoint()]; |
| 308 | - $cacheEntry = $mount->getStorage()->getCache()->get((int)$id); |
|
| 308 | + $cacheEntry = $mount->getStorage()->getCache()->get((int) $id); |
|
| 309 | 309 | if (!$cacheEntry) { |
| 310 | 310 | return []; |
| 311 | 311 | } |
| 312 | 312 | // cache jails will hide the "true" internal path |
| 313 | - $internalPath = ltrim($mountsContainingFile[0]->getRootInternalPath() . '/' . $cacheEntry->getPath(), '/'); |
|
| 313 | + $internalPath = ltrim($mountsContainingFile[0]->getRootInternalPath().'/'.$cacheEntry->getPath(), '/'); |
|
| 314 | 314 | |
| 315 | - $nodes = array_map(function (ICachedMountInfo $cachedMountInfo) use ($cacheEntry, $folderMounts, $internalPath) { |
|
| 315 | + $nodes = array_map(function(ICachedMountInfo $cachedMountInfo) use ($cacheEntry, $folderMounts, $internalPath) { |
|
| 316 | 316 | $mount = $folderMounts[$cachedMountInfo->getMountPoint()]; |
| 317 | 317 | $pathRelativeToMount = substr($internalPath, strlen($cachedMountInfo->getRootInternalPath())); |
| 318 | 318 | $pathRelativeToMount = ltrim($pathRelativeToMount, '/'); |
| 319 | - $absolutePath = $cachedMountInfo->getMountPoint() . $pathRelativeToMount; |
|
| 319 | + $absolutePath = $cachedMountInfo->getMountPoint().$pathRelativeToMount; |
|
| 320 | 320 | return $this->root->createNode($absolutePath, new \OC\Files\FileInfo( |
| 321 | 321 | $absolutePath, $mount->getStorage(), $cacheEntry->getPath(), $cacheEntry, $mount, |
| 322 | 322 | \OC::$server->getUserManager()->get($mount->getStorage()->getOwner($pathRelativeToMount)) |
| 323 | 323 | )); |
| 324 | 324 | }, $mountsContainingFile); |
| 325 | 325 | |
| 326 | - return array_filter($nodes, function (Node $node) { |
|
| 326 | + return array_filter($nodes, function(Node $node) { |
|
| 327 | 327 | return $this->getRelativePath($node->getPath()); |
| 328 | 328 | }); |
| 329 | 329 | } |
@@ -367,10 +367,10 @@ discard block |
||
| 367 | 367 | $mounts = $this->root->getMountsIn($this->path); |
| 368 | 368 | $mounts[] = $this->getMountPoint(); |
| 369 | 369 | |
| 370 | - $mounts = array_filter($mounts, function (IMountPoint $mount) { |
|
| 370 | + $mounts = array_filter($mounts, function(IMountPoint $mount) { |
|
| 371 | 371 | return $mount->getStorage(); |
| 372 | 372 | }); |
| 373 | - $storageIds = array_map(function (IMountPoint $mount) { |
|
| 373 | + $storageIds = array_map(function(IMountPoint $mount) { |
|
| 374 | 374 | return $mount->getStorage()->getCache()->getNumericStorageId(); |
| 375 | 375 | }, $mounts); |
| 376 | 376 | /** @var IMountPoint[] $mountMap */ |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | |
| 396 | 396 | $result = $query->execute()->fetchAll(); |
| 397 | 397 | |
| 398 | - $files = array_filter(array_map(function (array $entry) use ($mountMap, $mimetypeLoader) { |
|
| 398 | + $files = array_filter(array_map(function(array $entry) use ($mountMap, $mimetypeLoader) { |
|
| 399 | 399 | $mount = $mountMap[$entry['storage']]; |
| 400 | 400 | $entry['internalPath'] = $entry['path']; |
| 401 | 401 | $entry['mimetype'] = $mimetypeLoader->getMimetypeById($entry['mimetype']); |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | return $this->root->createNode($fileInfo->getPath(), $fileInfo); |
| 409 | 409 | }, $result)); |
| 410 | 410 | |
| 411 | - return array_values(array_filter($files, function (Node $node) { |
|
| 411 | + return array_values(array_filter($files, function(Node $node) { |
|
| 412 | 412 | $relative = $this->getRelativePath($node->getPath()); |
| 413 | 413 | return $relative !== null && $relative !== '/'; |
| 414 | 414 | })); |
@@ -422,13 +422,13 @@ discard block |
||
| 422 | 422 | $rootLength = strlen($jailRoot) + 1; |
| 423 | 423 | if ($path === $jailRoot) { |
| 424 | 424 | return $mount->getMountPoint(); |
| 425 | - } else if (substr($path, 0, $rootLength) === $jailRoot . '/') { |
|
| 426 | - return $mount->getMountPoint() . substr($path, $rootLength); |
|
| 425 | + } else if (substr($path, 0, $rootLength) === $jailRoot.'/') { |
|
| 426 | + return $mount->getMountPoint().substr($path, $rootLength); |
|
| 427 | 427 | } else { |
| 428 | 428 | return null; |
| 429 | 429 | } |
| 430 | 430 | } else { |
| 431 | - return $mount->getMountPoint() . $path; |
|
| 431 | + return $mount->getMountPoint().$path; |
|
| 432 | 432 | } |
| 433 | 433 | } |
| 434 | 434 | } |
@@ -11,19 +11,19 @@ |
||
| 11 | 11 | <p class="settings-hint"><?php p($l->t('Federation allows you to connect with other trusted servers to exchange the user directory. For example this will be used to auto-complete external users for federated sharing.')); ?></p> |
| 12 | 12 | |
| 13 | 13 | <p> |
| 14 | - <input id="autoAddServers" type="checkbox" class="checkbox" <?php if($_['autoAddServers']) p('checked'); ?> /> |
|
| 14 | + <input id="autoAddServers" type="checkbox" class="checkbox" <?php if ($_['autoAddServers']) p('checked'); ?> /> |
|
| 15 | 15 | <label for="autoAddServers"><?php p($l->t('Add server automatically once a federated share was created successfully')); ?></label> |
| 16 | 16 | </p> |
| 17 | 17 | |
| 18 | 18 | <ul id="listOfTrustedServers"> |
| 19 | - <?php foreach($_['trustedServers'] as $trustedServer) { ?> |
|
| 19 | + <?php foreach ($_['trustedServers'] as $trustedServer) { ?> |
|
| 20 | 20 | <li id="<?php p($trustedServer['id']); ?>"> |
| 21 | - <?php if((int)$trustedServer['status'] === TrustedServers::STATUS_OK) { ?> |
|
| 21 | + <?php if ((int) $trustedServer['status'] === TrustedServers::STATUS_OK) { ?> |
|
| 22 | 22 | <span class="status success"></span> |
| 23 | 23 | <?php |
| 24 | - } elseif( |
|
| 25 | - (int)$trustedServer['status'] === TrustedServers::STATUS_PENDING || |
|
| 26 | - (int)$trustedServer['status'] === TrustedServers::STATUS_ACCESS_REVOKED |
|
| 24 | + } elseif ( |
|
| 25 | + (int) $trustedServer['status'] === TrustedServers::STATUS_PENDING || |
|
| 26 | + (int) $trustedServer['status'] === TrustedServers::STATUS_ACCESS_REVOKED |
|
| 27 | 27 | ) { ?> |
| 28 | 28 | <span class="status indeterminate"></span> |
| 29 | 29 | <?php } else {?> |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $offset = $arguments['offset']; |
| 70 | 70 | $stopAt = $arguments['stopAt']; |
| 71 | 71 | |
| 72 | - $this->logger->info('Building calendar index (' . $offset .'/' . $stopAt . ')'); |
|
| 72 | + $this->logger->info('Building calendar index ('.$offset.'/'.$stopAt.')'); |
|
| 73 | 73 | |
| 74 | 74 | $offset = $this->buildIndex($offset, $stopAt); |
| 75 | 75 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | 'offset' => $offset, |
| 81 | 81 | 'stopAt' => $stopAt |
| 82 | 82 | ]); |
| 83 | - $this->logger->info('New building calendar index job scheduled with offset ' . $offset); |
|
| 83 | + $this->logger->info('New building calendar index job scheduled with offset '.$offset); |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | ->orderBy('id', 'ASC'); |
| 101 | 101 | |
| 102 | 102 | $stmt = $query->execute(); |
| 103 | - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
| 103 | + while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
| 104 | 104 | $offset = $row['id']; |
| 105 | 105 | |
| 106 | 106 | $calendarData = $row['calendardata']; |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | $query = $this->db->getQueryBuilder(); |
| 73 | 73 | $query->select($query->createFunction('MAX(id)')) |
| 74 | 74 | ->from('calendarobjects'); |
| 75 | - $maxId = (int)$query->execute()->fetchColumn(); |
|
| 75 | + $maxId = (int) $query->execute()->fetchColumn(); |
|
| 76 | 76 | |
| 77 | 77 | $output->info('Add background job'); |
| 78 | 78 | $this->jobList->add(BuildCalendarSearchIndexBackgroundJob::class, [ |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | $server->on('report', [$this, 'report']); |
| 76 | 76 | |
| 77 | - $server->xml->elementMap['{' . self::NS_Nextcloud . '}calendar-search'] = |
|
| 77 | + $server->xml->elementMap['{'.self::NS_Nextcloud.'}calendar-search'] = |
|
| 78 | 78 | 'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport'; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function report($reportName, $report, $path) { |
| 90 | 90 | switch ($reportName) { |
| 91 | - case '{' . self::NS_Nextcloud . '}calendar-search': |
|
| 91 | + case '{'.self::NS_Nextcloud.'}calendar-search': |
|
| 92 | 92 | $this->server->transactionType = 'report-nc-calendar-search'; |
| 93 | 93 | $this->calendarSearch($report); |
| 94 | 94 | return false; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | $reports = []; |
| 112 | 112 | if ($node instanceof CalendarHome) { |
| 113 | - $reports[] = '{' . self::NS_Nextcloud . '}calendar-search'; |
|
| 113 | + $reports[] = '{'.self::NS_Nextcloud.'}calendar-search'; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | return $reports; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | foreach ($nodePaths as $path) { |
| 142 | 142 | list($properties) = $this->server->getPropertiesForPath( |
| 143 | - $this->server->getRequestUri() . '/' . $path, |
|
| 143 | + $this->server->getRequestUri().'/'.$path, |
|
| 144 | 144 | $report->properties); |
| 145 | 145 | $result[] = $properties; |
| 146 | 146 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | public function __destruct() { |
| 67 | 67 | try { |
| 68 | 68 | $this->close(); |
| 69 | - } catch (SessionNotAvailableException $e){ |
|
| 69 | + } catch (SessionNotAvailableException $e) { |
|
| 70 | 70 | // This exception can occur if session is already closed |
| 71 | 71 | // So it is safe to ignore it and let the garbage collector to proceed |
| 72 | 72 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * @return string|null Either the value or null |
| 103 | 103 | */ |
| 104 | 104 | public function get($key) { |
| 105 | - if(isset($this->sessionValues[$key])) { |
|
| 105 | + if (isset($this->sessionValues[$key])) { |
|
| 106 | 106 | return $this->sessionValues[$key]; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | * Close the session and release the lock, also writes all changed data in batch |
| 169 | 169 | */ |
| 170 | 170 | public function close() { |
| 171 | - if($this->isModified) { |
|
| 171 | + if ($this->isModified) { |
|
| 172 | 172 | $encryptedValue = $this->crypto->encrypt(json_encode($this->sessionValues), $this->passphrase); |
| 173 | 173 | $this->session->set(self::encryptedSessionName, $encryptedValue); |
| 174 | 174 | $this->isModified = false; |
@@ -11,9 +11,9 @@ |
||
| 11 | 11 | <p class="settings-hint"><?php p($l->t('Allows users to share a personalized link to a file or folder by putting in an email address.')); ?></p> |
| 12 | 12 | |
| 13 | 13 | <p> |
| 14 | - <input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if($_['sendPasswordMail']) p('checked'); ?> /> |
|
| 14 | + <input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if ($_['sendPasswordMail']) p('checked'); ?> /> |
|
| 15 | 15 | <label for="sendPasswordMail"><?php p($l->t('Send password by mail')); ?></label><br/> |
| 16 | - <input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if($_['enforcePasswordProtection']) p('checked'); ?> /> |
|
| 16 | + <input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if ($_['enforcePasswordProtection']) p('checked'); ?> /> |
|
| 17 | 17 | <label for="enforcePasswordProtection"><?php p($l->t('Enforce password protection')); ?></label> |
| 18 | 18 | </p> |
| 19 | 19 | |
@@ -220,9 +220,9 @@ discard block |
||
| 220 | 220 | )) { |
| 221 | 221 | // note: pre-fetching only supported for depth <= 1 |
| 222 | 222 | $folderContent = $node->getChildren(); |
| 223 | - $fileIds[] = (int)$node->getId(); |
|
| 223 | + $fileIds[] = (int) $node->getId(); |
|
| 224 | 224 | foreach ($folderContent as $info) { |
| 225 | - $fileIds[] = (int)$info->getId(); |
|
| 225 | + $fileIds[] = (int) $info->getId(); |
|
| 226 | 226 | } |
| 227 | 227 | $tags = $this->getTagger()->getTagsForObjects($fileIds); |
| 228 | 228 | if ($tags === false) { |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | }); |
| 279 | 279 | |
| 280 | 280 | $propPatch->handle(self::FAVORITE_PROPERTYNAME, function($favState) use ($node) { |
| 281 | - if ((int)$favState === 1 || $favState === 'true') { |
|
| 281 | + if ((int) $favState === 1 || $favState === 'true') { |
|
| 282 | 282 | $this->getTagger()->tagAs($node->getId(), self::TAG_FAVORITE); |
| 283 | 283 | } else { |
| 284 | 284 | $this->getTagger()->unTag($node->getId(), self::TAG_FAVORITE); |
@@ -68,8 +68,8 @@ |
||
| 68 | 68 | $this->getBundles(), |
| 69 | 69 | $this->getDefaultInstallationBundle() |
| 70 | 70 | ); |
| 71 | - foreach($bundles as $bundle) { |
|
| 72 | - if($bundle->getIdentifier() === $identifier) { |
|
| 71 | + foreach ($bundles as $bundle) { |
|
| 72 | + if ($bundle->getIdentifier() === $identifier) { |
|
| 73 | 73 | return $bundle; |
| 74 | 74 | } |
| 75 | 75 | } |