Completed
Push — stable12 ( a63043...ca2f2c )
by Morris
15:51
created
apps/files_sharing/lib/SharedMount.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		$this->groupedShares = $arguments['groupedShares'];
75 75
 
76 76
 		$newMountPoint = $this->verifyMountPoint($this->superShare, $mountpoints, $folderExistCache);
77
-		$absMountPoint = '/' . $this->user . '/files' . $newMountPoint;
77
+		$absMountPoint = '/'.$this->user.'/files'.$newMountPoint;
78 78
 		parent::__construct($storage, $absMountPoint, $arguments, $loader);
79 79
 	}
80 80
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		}
102 102
 
103 103
 		$newMountPoint = $this->generateUniqueTarget(
104
-			\OC\Files\Filesystem::normalizePath($parent . '/' . $mountPoint),
104
+			\OC\Files\Filesystem::normalizePath($parent.'/'.$mountPoint),
105 105
 			$this->recipientView,
106 106
 			$mountpoints
107 107
 		);
@@ -138,15 +138,15 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	private function generateUniqueTarget($path, $view, array $mountpoints) {
140 140
 		$pathinfo = pathinfo($path);
141
-		$ext = (isset($pathinfo['extension'])) ? '.' . $pathinfo['extension'] : '';
141
+		$ext = (isset($pathinfo['extension'])) ? '.'.$pathinfo['extension'] : '';
142 142
 		$name = $pathinfo['filename'];
143 143
 		$dir = $pathinfo['dirname'];
144 144
 
145 145
 		$i = 2;
146
-		$absolutePath = $this->recipientView->getAbsolutePath($path) . '/';
146
+		$absolutePath = $this->recipientView->getAbsolutePath($path).'/';
147 147
 		while ($view->file_exists($path) || isset($mountpoints[$absolutePath])) {
148
-			$path = Filesystem::normalizePath($dir . '/' . $name . ' (' . $i . ')' . $ext);
149
-			$absolutePath = $this->recipientView->getAbsolutePath($path) . '/';
148
+			$path = Filesystem::normalizePath($dir.'/'.$name.' ('.$i.')'.$ext);
149
+			$absolutePath = $this->recipientView->getAbsolutePath($path).'/';
150 150
 			$i++;
151 151
 		}
152 152
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		// it is not a file relative to data/user/files
168 168
 		if (count($split) < 3 || $split[1] !== 'files') {
169 169
 			\OCP\Util::writeLog('file sharing',
170
-				'Can not strip userid and "files/" from path: ' . $path,
170
+				'Can not strip userid and "files/" from path: '.$path,
171 171
 				\OCP\Util::ERROR);
172 172
 			throw new \OCA\Files_Sharing\Exceptions\BrokenPath('Path does not start with /user/files', 10);
173 173
 		}
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 		$sliced = array_slice($split, 2);
177 177
 		$relPath = implode('/', $sliced);
178 178
 
179
-		return '/' . $relPath;
179
+		return '/'.$relPath;
180 180
 	}
181 181
 
182 182
 	/**
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 			$this->storage->setMountPoint($relTargetPath);
199 199
 		} catch (\Exception $e) {
200 200
 			\OCP\Util::writeLog('file sharing',
201
-				'Could not rename mount point for shared folder "' . $this->getMountPoint() . '" to "' . $target . '"',
201
+				'Could not rename mount point for shared folder "'.$this->getMountPoint().'" to "'.$target.'"',
202 202
 				\OCP\Util::ERROR);
203 203
 		}
204 204
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 			$row = $result->fetch();
254 254
 			$result->closeCursor();
255 255
 			if ($row) {
256
-				return (int)$row['storage'];
256
+				return (int) $row['storage'];
257 257
 			}
258 258
 			return -1;
259 259
 		}
Please login to merge, or discard this patch.
apps/files_sharing/lib/MountProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,14 +76,14 @@  discard block
 block discarded – undo
76 76
 		$shares = array_merge($shares, $this->shareManager->getSharedWith($user->getUID(), \OCP\Share::SHARE_TYPE_CIRCLE, null, -1));
77 77
 
78 78
 		// filter out excluded shares and group shares that includes self
79
-		$shares = array_filter($shares, function (\OCP\Share\IShare $share) use ($user) {
79
+		$shares = array_filter($shares, function(\OCP\Share\IShare $share) use ($user) {
80 80
 			return $share->getPermissions() > 0 && $share->getShareOwner() !== $user->getUID();
81 81
 		});
82 82
 
83 83
 		$superShares = $this->buildSuperShares($shares, $user);
84 84
 
85 85
 		$mounts = [];
86
-		$view = new View('/' . $user->getUID() . '/files');
86
+		$view = new View('/'.$user->getUID().'/files');
87 87
 		$ownerViews = [];
88 88
 		$sharingDisabledForUser = $this->shareManager->sharingDisabledForUser($user->getUID());
89 89
 		$foldersExistCache = new CappedMemoryCache();
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 				$parentShare = $share[0];
94 94
 				$owner = $parentShare->getShareOwner();
95 95
 				if (!isset($ownerViews[$owner])) {
96
-					$ownerViews[$owner] = new View('/' . $parentShare->getShareOwner() . '/files');
96
+					$ownerViews[$owner] = new View('/'.$parentShare->getShareOwner().'/files');
97 97
 				}
98 98
 				$mount = new SharedMount(
99 99
 					'\OCA\Files_Sharing\SharedStorage',
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 						// null groups which usually appear with group backend
204 204
 						// caching inconsistencies
205 205
 						$this->logger->debug(
206
-							'Could not adjust share target for share ' . $share->getId() . ' to make it consistent: ' . $e->getMessage(),
206
+							'Could not adjust share target for share '.$share->getId().' to make it consistent: '.$e->getMessage(),
207 207
 							['app' => 'files_sharing']
208 208
 						);
209 209
 					}
Please login to merge, or discard this patch.
lib/private/Files/View.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
 			$path = '/';
129 129
 		}
130 130
 		if ($path[0] !== '/') {
131
-			$path = '/' . $path;
131
+			$path = '/'.$path;
132 132
 		}
133
-		return $this->fakeRoot . $path;
133
+		return $this->fakeRoot.$path;
134 134
 	}
135 135
 
136 136
 	/**
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	public function chroot($fakeRoot) {
143 143
 		if (!$fakeRoot == '') {
144 144
 			if ($fakeRoot[0] !== '/') {
145
-				$fakeRoot = '/' . $fakeRoot;
145
+				$fakeRoot = '/'.$fakeRoot;
146 146
 			}
147 147
 		}
148 148
 		$this->fakeRoot = $fakeRoot;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 		}
175 175
 
176 176
 		// missing slashes can cause wrong matches!
177
-		$root = rtrim($this->fakeRoot, '/') . '/';
177
+		$root = rtrim($this->fakeRoot, '/').'/';
178 178
 
179 179
 		if (strpos($path, $root) !== 0) {
180 180
 			return null;
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 		if ($mount instanceof MoveableMount) {
281 281
 			// cut of /user/files to get the relative path to data/user/files
282 282
 			$pathParts = explode('/', $path, 4);
283
-			$relPath = '/' . $pathParts[3];
283
+			$relPath = '/'.$pathParts[3];
284 284
 			$this->lockFile($relPath, ILockingProvider::LOCK_SHARED, true);
285 285
 			\OC_Hook::emit(
286 286
 				Filesystem::CLASSNAME, "umount",
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 		}
712 712
 		$postFix = (substr($path, -1, 1) === '/') ? '/' : '';
713 713
 		$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
714
-		$mount = Filesystem::getMountManager()->find($absolutePath . $postFix);
714
+		$mount = Filesystem::getMountManager()->find($absolutePath.$postFix);
715 715
 		if ($mount and $mount->getInternalPath($absolutePath) === '') {
716 716
 			return $this->removeMount($mount, $absolutePath);
717 717
 		}
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
 								$this->renameUpdate($storage1, $storage2, $internalPath1, $internalPath2);
832 832
 							}
833 833
 						}
834
-					} catch(\Exception $e) {
834
+					} catch (\Exception $e) {
835 835
 						throw $e;
836 836
 					} finally {
837 837
 						$this->changeLock($path1, ILockingProvider::LOCK_SHARED, true);
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
 						}
856 856
 					}
857 857
 				}
858
-			} catch(\Exception $e) {
858
+			} catch (\Exception $e) {
859 859
 				throw $e;
860 860
 			} finally {
861 861
 				$this->unlockFile($path1, ILockingProvider::LOCK_SHARED, true);
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
 				$hooks[] = 'write';
989 989
 				break;
990 990
 			default:
991
-				\OCP\Util::writeLog('core', 'invalid mode (' . $mode . ') for ' . $path, \OCP\Util::ERROR);
991
+				\OCP\Util::writeLog('core', 'invalid mode ('.$mode.') for '.$path, \OCP\Util::ERROR);
992 992
 		}
993 993
 
994 994
 		if ($mode !== 'r' && $mode !== 'w') {
@@ -1092,7 +1092,7 @@  discard block
 block discarded – undo
1092 1092
 					array(Filesystem::signal_param_path => $this->getHookPath($path))
1093 1093
 				);
1094 1094
 			}
1095
-			list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix);
1095
+			list($storage, $internalPath) = Filesystem::resolvePath($absolutePath.$postFix);
1096 1096
 			if ($storage) {
1097 1097
 				$result = $storage->hash($type, $internalPath, $raw);
1098 1098
 				return $result;
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
 
1148 1148
 			$run = $this->runHooks($hooks, $path);
1149 1149
 			/** @var \OC\Files\Storage\Storage $storage */
1150
-			list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix);
1150
+			list($storage, $internalPath) = Filesystem::resolvePath($absolutePath.$postFix);
1151 1151
 			if ($run and $storage) {
1152 1152
 				if (in_array('write', $hooks) || in_array('delete', $hooks)) {
1153 1153
 					$this->changeLock($path, ILockingProvider::LOCK_EXCLUSIVE);
@@ -1186,7 +1186,7 @@  discard block
 block discarded – undo
1186 1186
 					$unlockLater = true;
1187 1187
 					// make sure our unlocking callback will still be called if connection is aborted
1188 1188
 					ignore_user_abort(true);
1189
-					$result = CallbackWrapper::wrap($result, null, null, function () use ($hooks, $path) {
1189
+					$result = CallbackWrapper::wrap($result, null, null, function() use ($hooks, $path) {
1190 1190
 						if (in_array('write', $hooks)) {
1191 1191
 							$this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE);
1192 1192
 						} else if (in_array('read', $hooks)) {
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
 			return true;
1248 1248
 		}
1249 1249
 
1250
-		return (strlen($fullPath) > strlen($defaultRoot)) && (substr($fullPath, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/');
1250
+		return (strlen($fullPath) > strlen($defaultRoot)) && (substr($fullPath, 0, strlen($defaultRoot) + 1) === $defaultRoot.'/');
1251 1251
 	}
1252 1252
 
1253 1253
 	/**
@@ -1266,7 +1266,7 @@  discard block
 block discarded – undo
1266 1266
 				if ($hook != 'read') {
1267 1267
 					\OC_Hook::emit(
1268 1268
 						Filesystem::CLASSNAME,
1269
-						$prefix . $hook,
1269
+						$prefix.$hook,
1270 1270
 						array(
1271 1271
 							Filesystem::signal_param_run => &$run,
1272 1272
 							Filesystem::signal_param_path => $path
@@ -1275,7 +1275,7 @@  discard block
 block discarded – undo
1275 1275
 				} elseif (!$post) {
1276 1276
 					\OC_Hook::emit(
1277 1277
 						Filesystem::CLASSNAME,
1278
-						$prefix . $hook,
1278
+						$prefix.$hook,
1279 1279
 						array(
1280 1280
 							Filesystem::signal_param_path => $path
1281 1281
 						)
@@ -1370,7 +1370,7 @@  discard block
 block discarded – undo
1370 1370
 			return $this->getPartFileInfo($path);
1371 1371
 		}
1372 1372
 		$relativePath = $path;
1373
-		$path = Filesystem::normalizePath($this->fakeRoot . '/' . $path);
1373
+		$path = Filesystem::normalizePath($this->fakeRoot.'/'.$path);
1374 1374
 
1375 1375
 		$mount = Filesystem::getMountManager()->find($path);
1376 1376
 		$storage = $mount->getStorage();
@@ -1394,7 +1394,7 @@  discard block
 block discarded – undo
1394 1394
 					//add the sizes of other mount points to the folder
1395 1395
 					$extOnly = ($includeMountPoints === 'ext');
1396 1396
 					$mounts = Filesystem::getMountManager()->findIn($path);
1397
-					$info->setSubMounts(array_filter($mounts, function (IMountPoint $mount) use ($extOnly) {
1397
+					$info->setSubMounts(array_filter($mounts, function(IMountPoint $mount) use ($extOnly) {
1398 1398
 						$subStorage = $mount->getStorage();
1399 1399
 						return !($extOnly && $subStorage instanceof \OCA\Files_Sharing\SharedStorage);
1400 1400
 					}));
@@ -1445,12 +1445,12 @@  discard block
 block discarded – undo
1445 1445
 			/**
1446 1446
 			 * @var \OC\Files\FileInfo[] $fileInfos
1447 1447
 			 */
1448
-			$fileInfos = array_map(function (ICacheEntry $content) use ($path, $storage, $mount, $sharingDisabled) {
1448
+			$fileInfos = array_map(function(ICacheEntry $content) use ($path, $storage, $mount, $sharingDisabled) {
1449 1449
 				if ($sharingDisabled) {
1450 1450
 					$content['permissions'] = $content['permissions'] & ~\OCP\Constants::PERMISSION_SHARE;
1451 1451
 				}
1452 1452
 				$owner = $this->getUserObjectForOwner($storage->getOwner($content['path']));
1453
-				return new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content, $mount, $owner);
1453
+				return new FileInfo($path.'/'.$content['name'], $storage, $content['path'], $content, $mount, $owner);
1454 1454
 			}, $contents);
1455 1455
 			$files = array_combine($fileNames, $fileInfos);
1456 1456
 
@@ -1476,8 +1476,8 @@  discard block
 block discarded – undo
1476 1476
 							// sometimes when the storage is not available it can be any exception
1477 1477
 							\OCP\Util::writeLog(
1478 1478
 								'core',
1479
-								'Exception while scanning storage "' . $subStorage->getId() . '": ' .
1480
-								get_class($e) . ': ' . $e->getMessage(),
1479
+								'Exception while scanning storage "'.$subStorage->getId().'": '.
1480
+								get_class($e).': '.$e->getMessage(),
1481 1481
 								\OCP\Util::ERROR
1482 1482
 							);
1483 1483
 							continue;
@@ -1507,7 +1507,7 @@  discard block
 block discarded – undo
1507 1507
 								$rootEntry['permissions'] = $permissions & (\OCP\Constants::PERMISSION_ALL - (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE));
1508 1508
 							}
1509 1509
 
1510
-							$rootEntry['path'] = substr(Filesystem::normalizePath($path . '/' . $rootEntry['name']), strlen($user) + 2); // full path without /$user/
1510
+							$rootEntry['path'] = substr(Filesystem::normalizePath($path.'/'.$rootEntry['name']), strlen($user) + 2); // full path without /$user/
1511 1511
 
1512 1512
 							// if sharing was disabled for the user we remove the share permissions
1513 1513
 							if (\OCP\Util::isSharingDisabledForUser()) {
@@ -1515,14 +1515,14 @@  discard block
 block discarded – undo
1515 1515
 							}
1516 1516
 
1517 1517
 							$owner = $this->getUserObjectForOwner($subStorage->getOwner(''));
1518
-							$files[$rootEntry->getName()] = new FileInfo($path . '/' . $rootEntry['name'], $subStorage, '', $rootEntry, $mount, $owner);
1518
+							$files[$rootEntry->getName()] = new FileInfo($path.'/'.$rootEntry['name'], $subStorage, '', $rootEntry, $mount, $owner);
1519 1519
 						}
1520 1520
 					}
1521 1521
 				}
1522 1522
 			}
1523 1523
 
1524 1524
 			if ($mimetype_filter) {
1525
-				$files = array_filter($files, function (FileInfo $file) use ($mimetype_filter) {
1525
+				$files = array_filter($files, function(FileInfo $file) use ($mimetype_filter) {
1526 1526
 					if (strpos($mimetype_filter, '/')) {
1527 1527
 						return $file->getMimetype() === $mimetype_filter;
1528 1528
 					} else {
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
 		if ($data instanceof FileInfo) {
1552 1552
 			$data = $data->getData();
1553 1553
 		}
1554
-		$path = Filesystem::normalizePath($this->fakeRoot . '/' . $path);
1554
+		$path = Filesystem::normalizePath($this->fakeRoot.'/'.$path);
1555 1555
 		/**
1556 1556
 		 * @var \OC\Files\Storage\Storage $storage
1557 1557
 		 * @var string $internalPath
@@ -1578,7 +1578,7 @@  discard block
 block discarded – undo
1578 1578
 	 * @return FileInfo[]
1579 1579
 	 */
1580 1580
 	public function search($query) {
1581
-		return $this->searchCommon('search', array('%' . $query . '%'));
1581
+		return $this->searchCommon('search', array('%'.$query.'%'));
1582 1582
 	}
1583 1583
 
1584 1584
 	/**
@@ -1629,10 +1629,10 @@  discard block
 block discarded – undo
1629 1629
 
1630 1630
 			$results = call_user_func_array(array($cache, $method), $args);
1631 1631
 			foreach ($results as $result) {
1632
-				if (substr($mountPoint . $result['path'], 0, $rootLength + 1) === $this->fakeRoot . '/') {
1632
+				if (substr($mountPoint.$result['path'], 0, $rootLength + 1) === $this->fakeRoot.'/') {
1633 1633
 					$internalPath = $result['path'];
1634
-					$path = $mountPoint . $result['path'];
1635
-					$result['path'] = substr($mountPoint . $result['path'], $rootLength);
1634
+					$path = $mountPoint.$result['path'];
1635
+					$result['path'] = substr($mountPoint.$result['path'], $rootLength);
1636 1636
 					$owner = \OC::$server->getUserManager()->get($storage->getOwner($internalPath));
1637 1637
 					$files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner);
1638 1638
 				}
@@ -1650,8 +1650,8 @@  discard block
 block discarded – undo
1650 1650
 					if ($results) {
1651 1651
 						foreach ($results as $result) {
1652 1652
 							$internalPath = $result['path'];
1653
-							$result['path'] = rtrim($relativeMountPoint . $result['path'], '/');
1654
-							$path = rtrim($mountPoint . $internalPath, '/');
1653
+							$result['path'] = rtrim($relativeMountPoint.$result['path'], '/');
1654
+							$path = rtrim($mountPoint.$internalPath, '/');
1655 1655
 							$owner = \OC::$server->getUserManager()->get($storage->getOwner($internalPath));
1656 1656
 							$files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner);
1657 1657
 						}
@@ -1672,7 +1672,7 @@  discard block
 block discarded – undo
1672 1672
 	public function getOwner($path) {
1673 1673
 		$info = $this->getFileInfo($path);
1674 1674
 		if (!$info) {
1675
-			throw new NotFoundException($path . ' not found while trying to get owner');
1675
+			throw new NotFoundException($path.' not found while trying to get owner');
1676 1676
 		}
1677 1677
 		return $info->getOwner()->getUID();
1678 1678
 	}
@@ -1706,7 +1706,7 @@  discard block
 block discarded – undo
1706 1706
 	 * @return string
1707 1707
 	 */
1708 1708
 	public function getPath($id) {
1709
-		$id = (int)$id;
1709
+		$id = (int) $id;
1710 1710
 		$manager = Filesystem::getMountManager();
1711 1711
 		$mounts = $manager->findIn($this->fakeRoot);
1712 1712
 		$mounts[] = $manager->find($this->fakeRoot);
@@ -1724,7 +1724,7 @@  discard block
 block discarded – undo
1724 1724
 				}
1725 1725
 				$internalPath = $cache->getPathById($id);
1726 1726
 				if (is_string($internalPath)) {
1727
-					$fullPath = $mount->getMountPoint() . $internalPath;
1727
+					$fullPath = $mount->getMountPoint().$internalPath;
1728 1728
 					if (!is_null($path = $this->getRelativePath($fullPath))) {
1729 1729
 						return $path;
1730 1730
 					}
@@ -1767,10 +1767,10 @@  discard block
 block discarded – undo
1767 1767
 		}
1768 1768
 
1769 1769
 		// note: cannot use the view because the target is already locked
1770
-		$fileId = (int)$targetStorage->getCache()->getId($targetInternalPath);
1770
+		$fileId = (int) $targetStorage->getCache()->getId($targetInternalPath);
1771 1771
 		if ($fileId === -1) {
1772 1772
 			// target might not exist, need to check parent instead
1773
-			$fileId = (int)$targetStorage->getCache()->getId(dirname($targetInternalPath));
1773
+			$fileId = (int) $targetStorage->getCache()->getId(dirname($targetInternalPath));
1774 1774
 		}
1775 1775
 
1776 1776
 		// check if any of the parents were shared by the current owner (include collections)
@@ -1870,7 +1870,7 @@  discard block
 block discarded – undo
1870 1870
 		$resultPath = '';
1871 1871
 		foreach ($parts as $part) {
1872 1872
 			if ($part) {
1873
-				$resultPath .= '/' . $part;
1873
+				$resultPath .= '/'.$part;
1874 1874
 				$result[] = $resultPath;
1875 1875
 			}
1876 1876
 		}
@@ -2133,16 +2133,16 @@  discard block
 block discarded – undo
2133 2133
 	public function getUidAndFilename($filename) {
2134 2134
 		$info = $this->getFileInfo($filename);
2135 2135
 		if (!$info instanceof \OCP\Files\FileInfo) {
2136
-			throw new NotFoundException($this->getAbsolutePath($filename) . ' not found');
2136
+			throw new NotFoundException($this->getAbsolutePath($filename).' not found');
2137 2137
 		}
2138 2138
 		$uid = $info->getOwner()->getUID();
2139 2139
 		if ($uid != \OCP\User::getUser()) {
2140 2140
 			Filesystem::initMountPoints($uid);
2141
-			$ownerView = new View('/' . $uid . '/files');
2141
+			$ownerView = new View('/'.$uid.'/files');
2142 2142
 			try {
2143 2143
 				$filename = $ownerView->getPath($info['fileid']);
2144 2144
 			} catch (NotFoundException $e) {
2145
-				throw new NotFoundException('File with id ' . $info['fileid'] . ' not found for user ' . $uid);
2145
+				throw new NotFoundException('File with id '.$info['fileid'].' not found for user '.$uid);
2146 2146
 			}
2147 2147
 		}
2148 2148
 		return [$uid, $filename];
@@ -2159,7 +2159,7 @@  discard block
 block discarded – undo
2159 2159
 		$directoryParts = array_filter($directoryParts);
2160 2160
 		foreach ($directoryParts as $key => $part) {
2161 2161
 			$currentPathElements = array_slice($directoryParts, 0, $key);
2162
-			$currentPath = '/' . implode('/', $currentPathElements);
2162
+			$currentPath = '/'.implode('/', $currentPathElements);
2163 2163
 			if ($this->is_file($currentPath)) {
2164 2164
 				return false;
2165 2165
 			}
Please login to merge, or discard this patch.
lib/private/Files/Config/UserMountCache.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
 
88 88
 	public function registerMounts(IUser $user, array $mounts) {
89 89
 		// filter out non-proper storages coming from unit tests
90
-		$mounts = array_filter($mounts, function (IMountPoint $mount) {
90
+		$mounts = array_filter($mounts, function(IMountPoint $mount) {
91 91
 			return $mount instanceof SharedMount || $mount->getStorage() && $mount->getStorage()->getCache();
92 92
 		});
93 93
 		/** @var ICachedMountInfo[] $newMounts */
94
-		$newMounts = array_map(function (IMountPoint $mount) use ($user) {
94
+		$newMounts = array_map(function(IMountPoint $mount) use ($user) {
95 95
 			// filter out any storages which aren't scanned yet since we aren't interested in files from those storages (yet)
96 96
 			if ($mount->getStorageRootId() === -1) {
97 97
 				return null;
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
 			}
101 101
 		}, $mounts);
102 102
 		$newMounts = array_values(array_filter($newMounts));
103
-		$newMountRootIds = array_map(function (ICachedMountInfo $mount) {
103
+		$newMountRootIds = array_map(function(ICachedMountInfo $mount) {
104 104
 			return $mount->getRootId();
105 105
 		}, $newMounts);
106 106
 		$newMounts = array_combine($newMountRootIds, $newMounts);
107 107
 
108 108
 		$cachedMounts = $this->getMountsForUser($user);
109
-		$cachedMountRootIds = array_map(function (ICachedMountInfo $mount) {
109
+		$cachedMountRootIds = array_map(function(ICachedMountInfo $mount) {
110 110
 			return $mount->getRootId();
111 111
 		}, $cachedMounts);
112 112
 		$cachedMounts = array_combine($cachedMountRootIds, $cachedMounts);
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 			], ['root_id', 'user_id']);
181 181
 		} else {
182 182
 			// in some cases this is legitimate, like orphaned shares
183
-			$this->logger->debug('Could not get storage info for mount at ' . $mount->getMountPoint());
183
+			$this->logger->debug('Could not get storage info for mount at '.$mount->getMountPoint());
184 184
 		}
185 185
 	}
186 186
 
@@ -213,9 +213,9 @@  discard block
 block discarded – undo
213 213
 		}
214 214
 		$mount_id = $row['mount_id'];
215 215
 		if (!is_null($mount_id)) {
216
-			$mount_id = (int)$mount_id;
216
+			$mount_id = (int) $mount_id;
217 217
 		}
218
-		return new CachedMountInfo($user, (int)$row['storage_id'], (int)$row['root_id'], $row['mount_point'], $mount_id, isset($row['path'])? $row['path']:'');
218
+		return new CachedMountInfo($user, (int) $row['storage_id'], (int) $row['root_id'], $row['mount_point'], $mount_id, isset($row['path']) ? $row['path'] : '');
219 219
 	}
220 220
 
221 221
 	/**
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 		$builder = $this->connection->getQueryBuilder();
247 247
 		$query = $builder->select('storage_id', 'root_id', 'user_id', 'mount_point', 'mount_id', 'f.path')
248 248
 			->from('mounts', 'm')
249
-			->innerJoin('m', 'filecache', 'f' , $builder->expr()->eq('m.root_id', 'f.fileid'))
249
+			->innerJoin('m', 'filecache', 'f', $builder->expr()->eq('m.root_id', 'f.fileid'))
250 250
 			->where($builder->expr()->eq('storage_id', $builder->createPositionalParameter($numericStorageId, IQueryBuilder::PARAM_INT)));
251 251
 
252 252
 		if ($user) {
@@ -289,12 +289,12 @@  discard block
 block discarded – undo
289 289
 			$row = $query->execute()->fetch();
290 290
 			if (is_array($row)) {
291 291
 				$this->cacheInfoCache[$fileId] = [
292
-					(int)$row['storage'],
292
+					(int) $row['storage'],
293 293
 					$row['path'],
294
-					(int)$row['mimetype']
294
+					(int) $row['mimetype']
295 295
 				];
296 296
 			} else {
297
-				throw new NotFoundException('File with id "' . $fileId . '" not found');
297
+				throw new NotFoundException('File with id "'.$fileId.'" not found');
298 298
 			}
299 299
 		}
300 300
 		return $this->cacheInfoCache[$fileId];
@@ -315,16 +315,16 @@  discard block
 block discarded – undo
315 315
 		$mountsForStorage = $this->getMountsForStorageId($storageId, $user);
316 316
 
317 317
 		// filter mounts that are from the same storage but a different directory
318
-		$filteredMounts = array_filter($mountsForStorage, function (ICachedMountInfo $mount) use ($internalPath, $fileId) {
318
+		$filteredMounts = array_filter($mountsForStorage, function(ICachedMountInfo $mount) use ($internalPath, $fileId) {
319 319
 			if ($fileId === $mount->getRootId()) {
320 320
 				return true;
321 321
 			}
322 322
 			$internalMountPath = $mount->getRootInternalPath();
323 323
 
324
-			return $internalMountPath === '' || substr($internalPath, 0, strlen($internalMountPath) + 1) === $internalMountPath . '/';
324
+			return $internalMountPath === '' || substr($internalPath, 0, strlen($internalMountPath) + 1) === $internalMountPath.'/';
325 325
 		});
326 326
 
327
-		return array_map(function (ICachedMountInfo $mount) use ($internalPath) {
327
+		return array_map(function(ICachedMountInfo $mount) use ($internalPath) {
328 328
 			return new CachedMountFileInfo(
329 329
 				$mount->getUser(),
330 330
 				$mount->getStorageId(),
Please login to merge, or discard this patch.
lib/private/Files/Mount/Manager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
 
84 84
 		$current = $path;
85 85
 		while (true) {
86
-			$mountPoint = $current . '/';
86
+			$mountPoint = $current.'/';
87 87
 			if (isset($this->mounts[$mountPoint])) {
88 88
 				return $this->mounts[$mountPoint];
89 89
 			}
Please login to merge, or discard this patch.
lib/private/Share20/Manager.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 
344 344
 		if ($fullId === null && $expirationDate === null && $this->shareApiLinkDefaultExpireDate()) {
345 345
 			$expirationDate = new \DateTime();
346
-			$expirationDate->setTime(0,0,0);
346
+			$expirationDate->setTime(0, 0, 0);
347 347
 			$expirationDate->add(new \DateInterval('P'.$this->shareApiLinkDefaultExpireDays().'D'));
348 348
 		}
349 349
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 
356 356
 			$date = new \DateTime();
357 357
 			$date->setTime(0, 0, 0);
358
-			$date->add(new \DateInterval('P' . $this->shareApiLinkDefaultExpireDays() . 'D'));
358
+			$date->add(new \DateInterval('P'.$this->shareApiLinkDefaultExpireDays().'D'));
359 359
 			if ($date < $expirationDate) {
360 360
 				$message = $this->l->t('Cannot set expiration date more than %s days in the future', [$this->shareApiLinkDefaultExpireDays()]);
361 361
 				throw new GenericShareException($message, $message, 404);
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 		 */
409 409
 		$provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_USER);
410 410
 		$existingShares = $provider->getSharesByPath($share->getNode());
411
-		foreach($existingShares as $existingShare) {
411
+		foreach ($existingShares as $existingShare) {
412 412
 			// Ignore if it is the same share
413 413
 			try {
414 414
 				if ($existingShare->getFullId() === $share->getFullId()) {
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 		 */
466 466
 		$provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_GROUP);
467 467
 		$existingShares = $provider->getSharesByPath($share->getNode());
468
-		foreach($existingShares as $existingShare) {
468
+		foreach ($existingShares as $existingShare) {
469 469
 			try {
470 470
 				if ($existingShare->getFullId() === $share->getFullId()) {
471 471
 					continue;
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 		// Make sure that we do not share a path that contains a shared mountpoint
535 535
 		if ($path instanceof \OCP\Files\Folder) {
536 536
 			$mounts = $this->mountManager->findIn($path->getPath());
537
-			foreach($mounts as $mount) {
537
+			foreach ($mounts as $mount) {
538 538
 				if ($mount->getStorage()->instanceOfStorage('\OCA\Files_Sharing\ISharedStorage')) {
539 539
 					throw new \InvalidArgumentException('Path contains files shared with you');
540 540
 				}
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 		$storage = $share->getNode()->getStorage();
583 583
 		if ($storage->instanceOfStorage('OCA\Files_Sharing\External\Storage')) {
584 584
 			$parent = $share->getNode()->getParent();
585
-			while($parent->getStorage()->instanceOfStorage('OCA\Files_Sharing\External\Storage')) {
585
+			while ($parent->getStorage()->instanceOfStorage('OCA\Files_Sharing\External\Storage')) {
586 586
 				$parent = $parent->getParent();
587 587
 			}
588 588
 			$share->setShareOwner($parent->getOwner()->getUID());
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 		}
640 640
 
641 641
 		// Generate the target
642
-		$target = $this->config->getSystemValue('share_folder', '/') .'/'. $share->getNode()->getName();
642
+		$target = $this->config->getSystemValue('share_folder', '/').'/'.$share->getNode()->getName();
643 643
 		$target = \OC\Files\Filesystem::normalizePath($target);
644 644
 		$share->setTarget($target);
645 645
 
@@ -700,17 +700,17 @@  discard block
 block discarded – undo
700 700
 					$this->sendMailNotification(
701 701
 						$l,
702 702
 						$share->getNode()->getName(),
703
-						$this->urlGenerator->linkToRouteAbsolute('files.viewcontroller.showFile', [ 'fileid' => $share->getNode()->getId() ]),
703
+						$this->urlGenerator->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $share->getNode()->getId()]),
704 704
 						$share->getSharedBy(),
705 705
 						$emailAddress,
706 706
 						$share->getExpirationDate()
707 707
 					);
708
-					$this->logger->debug('Send share notification to ' . $emailAddress . ' for share with ID ' . $share->getId(), ['app' => 'share']);
708
+					$this->logger->debug('Send share notification to '.$emailAddress.' for share with ID '.$share->getId(), ['app' => 'share']);
709 709
 				} else {
710
-					$this->logger->debug('Share notification not send to ' . $share->getSharedWith() . ' because email address is not set.', ['app' => 'share']);
710
+					$this->logger->debug('Share notification not send to '.$share->getSharedWith().' because email address is not set.', ['app' => 'share']);
711 711
 				}
712 712
 			} else {
713
-				$this->logger->debug('Share notification not send to ' . $share->getSharedWith() . ' because user could not be found.', ['app' => 'share']);
713
+				$this->logger->debug('Share notification not send to '.$share->getSharedWith().' because user could not be found.', ['app' => 'share']);
714 714
 			}
715 715
 		}
716 716
 
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 		$text = $l->t('%s shared »%s« with you.', [$initiatorDisplayName, $filename]);
752 752
 
753 753
 		$emailTemplate->addBodyText(
754
-			$text . ' ' . $l->t('Click the button below to open it.'),
754
+			$text.' '.$l->t('Click the button below to open it.'),
755 755
 			$text
756 756
 		);
757 757
 		$emailTemplate->addBodyButton(
@@ -775,9 +775,9 @@  discard block
 block discarded – undo
775 775
 		// The "Reply-To" is set to the sharer if an mail address is configured
776 776
 		// also the default footer contains a "Do not reply" which needs to be adjusted.
777 777
 		$initiatorEmail = $initiatorUser->getEMailAddress();
778
-		if($initiatorEmail !== null) {
778
+		if ($initiatorEmail !== null) {
779 779
 			$message->setReplyTo([$initiatorEmail => $initiatorDisplayName]);
780
-			$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
780
+			$emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan());
781 781
 		} else {
782 782
 			$emailTemplate->addFooter();
783 783
 		}
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
 	 * @param string $recipientId
989 989
 	 */
990 990
 	public function deleteFromSelf(\OCP\Share\IShare $share, $recipientId) {
991
-		list($providerId, ) = $this->splitFullId($share->getFullId());
991
+		list($providerId,) = $this->splitFullId($share->getFullId());
992 992
 		$provider = $this->factory->getProvider($providerId);
993 993
 
994 994
 		$provider->deleteFromSelf($share, $recipientId);
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
 		if ($share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP) {
1010 1010
 			$sharedWith = $this->groupManager->get($share->getSharedWith());
1011 1011
 			if (is_null($sharedWith)) {
1012
-				throw new \InvalidArgumentException('Group "' . $share->getSharedWith() . '" does not exist');
1012
+				throw new \InvalidArgumentException('Group "'.$share->getSharedWith().'" does not exist');
1013 1013
 			}
1014 1014
 			$recipient = $this->userManager->get($recipientId);
1015 1015
 			if (!$sharedWith->inGroup($recipient)) {
@@ -1017,7 +1017,7 @@  discard block
 block discarded – undo
1017 1017
 			}
1018 1018
 		}
1019 1019
 
1020
-		list($providerId, ) = $this->splitFullId($share->getFullId());
1020
+		list($providerId,) = $this->splitFullId($share->getFullId());
1021 1021
 		$provider = $this->factory->getProvider($providerId);
1022 1022
 
1023 1023
 		$provider->move($share, $recipientId);
@@ -1064,7 +1064,7 @@  discard block
 block discarded – undo
1064 1064
 
1065 1065
 		$shares2 = [];
1066 1066
 
1067
-		while(true) {
1067
+		while (true) {
1068 1068
 			$added = 0;
1069 1069
 			foreach ($shares as $share) {
1070 1070
 
@@ -1164,7 +1164,7 @@  discard block
 block discarded – undo
1164 1164
 	 *
1165 1165
 	 * @return Share[]
1166 1166
 	 */
1167
-	public function getSharesByPath(\OCP\Files\Node $path, $page=0, $perPage=50) {
1167
+	public function getSharesByPath(\OCP\Files\Node $path, $page = 0, $perPage = 50) {
1168 1168
 		return [];
1169 1169
 	}
1170 1170
 
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
 		}
1184 1184
 		$share = null;
1185 1185
 		try {
1186
-			if($this->shareApiAllowLinks()) {
1186
+			if ($this->shareApiAllowLinks()) {
1187 1187
 				$provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_LINK);
1188 1188
 				$share = $provider->getShareByToken($token);
1189 1189
 			}
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
 			}
1391 1391
 			$al['users'][$owner] = [
1392 1392
 				'node_id' => $path->getId(),
1393
-				'node_path' => '/' . $ownerPath,
1393
+				'node_path' => '/'.$ownerPath,
1394 1394
 			];
1395 1395
 		} else {
1396 1396
 			$al['users'][] = $owner;
@@ -1490,7 +1490,7 @@  discard block
 block discarded – undo
1490 1490
 	 * @return int
1491 1491
 	 */
1492 1492
 	public function shareApiLinkDefaultExpireDays() {
1493
-		return (int)$this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7');
1493
+		return (int) $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7');
1494 1494
 	}
1495 1495
 
1496 1496
 	/**
Please login to merge, or discard this patch.