@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | public function registerMounts(IUser $user, array $mounts) { |
| 90 | 90 | // filter out non-proper storages coming from unit tests |
| 91 | - $mounts = array_filter($mounts, function (IMountPoint $mount) { |
|
| 91 | + $mounts = array_filter($mounts, function(IMountPoint $mount) { |
|
| 92 | 92 | return $mount instanceof SharedMount || $mount->getStorage() && $mount->getStorage()->getCache(); |
| 93 | 93 | }); |
| 94 | 94 | /** @var ICachedMountInfo[] $newMounts */ |
| 95 | - $newMounts = array_map(function (IMountPoint $mount) use ($user) { |
|
| 95 | + $newMounts = array_map(function(IMountPoint $mount) use ($user) { |
|
| 96 | 96 | // filter out any storages which aren't scanned yet since we aren't interested in files from those storages (yet) |
| 97 | 97 | if ($mount->getStorageRootId() === -1) { |
| 98 | 98 | return null; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $newMounts = array_values(array_filter($newMounts)); |
| 104 | 104 | |
| 105 | 105 | $cachedMounts = $this->getMountsForUser($user); |
| 106 | - $mountDiff = function (ICachedMountInfo $mount1, ICachedMountInfo $mount2) { |
|
| 106 | + $mountDiff = function(ICachedMountInfo $mount1, ICachedMountInfo $mount2) { |
|
| 107 | 107 | // since we are only looking for mounts for a specific user comparing on root id is enough |
| 108 | 108 | return $mount1->getRootId() - $mount2->getRootId(); |
| 109 | 109 | }; |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | ], ['root_id', 'user_id']); |
| 165 | 165 | } else { |
| 166 | 166 | // in some cases this is legitimate, like orphaned shares |
| 167 | - $this->logger->debug('Could not get storage info for mount at ' . $mount->getMountPoint()); |
|
| 167 | + $this->logger->debug('Could not get storage info for mount at '.$mount->getMountPoint()); |
|
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | if (is_null($user)) { |
| 196 | 196 | return null; |
| 197 | 197 | } |
| 198 | - return new CachedMountInfo($user, (int)$row['storage_id'], (int)$row['root_id'], $row['mount_point'], $row['mount_id'], isset($row['path']) ? $row['path'] : ''); |
|
| 198 | + return new CachedMountInfo($user, (int) $row['storage_id'], (int) $row['root_id'], $row['mount_point'], $row['mount_id'], isset($row['path']) ? $row['path'] : ''); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
@@ -269,12 +269,12 @@ discard block |
||
| 269 | 269 | $row = $query->execute()->fetch(); |
| 270 | 270 | if (is_array($row)) { |
| 271 | 271 | $this->cacheInfoCache[$fileId] = [ |
| 272 | - (int)$row['storage'], |
|
| 272 | + (int) $row['storage'], |
|
| 273 | 273 | $row['path'], |
| 274 | - (int)$row['mimetype'] |
|
| 274 | + (int) $row['mimetype'] |
|
| 275 | 275 | ]; |
| 276 | 276 | } else { |
| 277 | - throw new NotFoundException('File with id "' . $fileId . '" not found'); |
|
| 277 | + throw new NotFoundException('File with id "'.$fileId.'" not found'); |
|
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | return $this->cacheInfoCache[$fileId]; |
@@ -295,16 +295,16 @@ discard block |
||
| 295 | 295 | $mountsForStorage = $this->getMountsForStorageId($storageId, $user); |
| 296 | 296 | |
| 297 | 297 | // filter mounts that are from the same storage but a different directory |
| 298 | - $filteredMounts = array_filter($mountsForStorage, function (ICachedMountInfo $mount) use ($internalPath, $fileId) { |
|
| 298 | + $filteredMounts = array_filter($mountsForStorage, function(ICachedMountInfo $mount) use ($internalPath, $fileId) { |
|
| 299 | 299 | if ($fileId === $mount->getRootId()) { |
| 300 | 300 | return true; |
| 301 | 301 | } |
| 302 | 302 | $internalMountPath = $mount->getRootInternalPath(); |
| 303 | 303 | |
| 304 | - return $internalMountPath === '' || substr($internalPath, 0, strlen($internalMountPath) + 1) === $internalMountPath . '/'; |
|
| 304 | + return $internalMountPath === '' || substr($internalPath, 0, strlen($internalMountPath) + 1) === $internalMountPath.'/'; |
|
| 305 | 305 | }); |
| 306 | 306 | |
| 307 | - return array_map(function (ICachedMountInfo $mount) use ($internalPath) { |
|
| 307 | + return array_map(function(ICachedMountInfo $mount) use ($internalPath) { |
|
| 308 | 308 | return new CachedMountFileInfo( |
| 309 | 309 | $mount->getUser(), |
| 310 | 310 | $mount->getStorageId(), |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | $slash |
| 363 | 363 | ); |
| 364 | 364 | |
| 365 | - $userIds = array_map(function (IUser $user) { |
|
| 365 | + $userIds = array_map(function(IUser $user) { |
|
| 366 | 366 | return $user->getUID(); |
| 367 | 367 | }, $users); |
| 368 | 368 | |
@@ -43,6 +43,6 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public function getPath() { |
| 46 | - return $this->getMountPoint() . $this->getInternalPath(); |
|
| 46 | + return $this->getMountPoint().$this->getInternalPath(); |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | \ No newline at end of file |