Completed
Push — master ( f9d8eb...989a8a )
by Lukas
14:49
created
lib/private/Files/Config/CachedMountFileInfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,6 +43,6 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
lib/private/Files/Config/UserMountCache.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 
90 90
 	public function registerMounts(IUser $user, array $mounts) {
91 91
 		// filter out non-proper storages coming from unit tests
92
-		$mounts = array_filter($mounts, function (IMountPoint $mount) {
92
+		$mounts = array_filter($mounts, function(IMountPoint $mount) {
93 93
 			return $mount instanceof SharedMount || $mount->getStorage() && $mount->getStorage()->getCache();
94 94
 		});
95 95
 		/** @var ICachedMountInfo[] $newMounts */
96
-		$newMounts = array_map(function (IMountPoint $mount) use ($user) {
96
+		$newMounts = array_map(function(IMountPoint $mount) use ($user) {
97 97
 			// filter out any storages which aren't scanned yet since we aren't interested in files from those storages (yet)
98 98
 			if ($mount->getStorageRootId() === -1) {
99 99
 				return null;
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 		$newMounts = array_values(array_filter($newMounts));
105 105
 
106 106
 		$cachedMounts = $this->getMountsForUser($user);
107
-		$mountDiff = function (ICachedMountInfo $mount1, ICachedMountInfo $mount2) {
107
+		$mountDiff = function(ICachedMountInfo $mount1, ICachedMountInfo $mount2) {
108 108
 			// since we are only looking for mounts for a specific user comparing on root id is enough
109 109
 			return $mount1->getRootId() - $mount2->getRootId();
110 110
 		};
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 			], ['root_id', 'user_id']);
166 166
 		} else {
167 167
 			// in some cases this is legitimate, like orphaned shares
168
-			$this->logger->debug('Could not get storage info for mount at ' . $mount->getMountPoint());
168
+			$this->logger->debug('Could not get storage info for mount at '.$mount->getMountPoint());
169 169
 		}
170 170
 	}
171 171
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 		if (!is_null($mount_id)) {
201 201
 			$mount_id = (int) $mount_id;
202 202
 		}
203
-		return new CachedMountInfo($user, (int)$row['storage_id'], (int)$row['root_id'], $row['mount_point'], $mount_id, isset($row['path']) ? $row['path'] : '');
203
+		return new CachedMountInfo($user, (int) $row['storage_id'], (int) $row['root_id'], $row['mount_point'], $mount_id, isset($row['path']) ? $row['path'] : '');
204 204
 	}
205 205
 
206 206
 	/**
@@ -274,12 +274,12 @@  discard block
 block discarded – undo
274 274
 			$row = $query->execute()->fetch();
275 275
 			if (is_array($row)) {
276 276
 				$this->cacheInfoCache[$fileId] = [
277
-					(int)$row['storage'],
277
+					(int) $row['storage'],
278 278
 					$row['path'],
279
-					(int)$row['mimetype']
279
+					(int) $row['mimetype']
280 280
 				];
281 281
 			} else {
282
-				throw new NotFoundException('File with id "' . $fileId . '" not found');
282
+				throw new NotFoundException('File with id "'.$fileId.'" not found');
283 283
 			}
284 284
 		}
285 285
 		return $this->cacheInfoCache[$fileId];
@@ -300,16 +300,16 @@  discard block
 block discarded – undo
300 300
 		$mountsForStorage = $this->getMountsForStorageId($storageId, $user);
301 301
 
302 302
 		// filter mounts that are from the same storage but a different directory
303
-		$filteredMounts = array_filter($mountsForStorage, function (ICachedMountInfo $mount) use ($internalPath, $fileId) {
303
+		$filteredMounts = array_filter($mountsForStorage, function(ICachedMountInfo $mount) use ($internalPath, $fileId) {
304 304
 			if ($fileId === $mount->getRootId()) {
305 305
 				return true;
306 306
 			}
307 307
 			$internalMountPath = $mount->getRootInternalPath();
308 308
 
309
-			return $internalMountPath === '' || substr($internalPath, 0, strlen($internalMountPath) + 1) === $internalMountPath . '/';
309
+			return $internalMountPath === '' || substr($internalPath, 0, strlen($internalMountPath) + 1) === $internalMountPath.'/';
310 310
 		});
311 311
 
312
-		return array_map(function (ICachedMountInfo $mount) use ($internalPath) {
312
+		return array_map(function(ICachedMountInfo $mount) use ($internalPath) {
313 313
 			return new CachedMountFileInfo(
314 314
 				$mount->getUser(),
315 315
 				$mount->getStorageId(),
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 			$slash
368 368
 		);
369 369
 
370
-		$userIds = array_map(function (IUser $user) {
370
+		$userIds = array_map(function(IUser $user) {
371 371
 			return $user->getUID();
372 372
 		}, $users);
373 373
 
Please login to merge, or discard this patch.