Completed
Pull Request — master (#4617)
by Julius
14:00
created
lib/private/Files/Node/Root.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -372,12 +372,12 @@
 block discarded – undo
372 372
 			\OC\Files\Filesystem::initMountPoints($userId);
373 373
 
374 374
 			try {
375
-				$folder = $this->get('/' . $userId . '/files');
375
+				$folder = $this->get('/'.$userId.'/files');
376 376
 			} catch (NotFoundException $e) {
377
-				if (!$this->nodeExists('/' . $userId)) {
378
-					$this->newFolder('/' . $userId);
377
+				if (!$this->nodeExists('/'.$userId)) {
378
+					$this->newFolder('/'.$userId);
379 379
 				}
380
-				$folder = $this->newFolder('/' . $userId . '/files');
380
+				$folder = $this->newFolder('/'.$userId.'/files');
381 381
 			}
382 382
 
383 383
 			$this->userFolderCache->set($userId, $folder);
Please login to merge, or discard this patch.
lib/private/Files/Node/Node.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 		$path = str_replace('\\', '/', $path);
289 289
 		//add leading slash
290 290
 		if ($path[0] !== '/') {
291
-			$path = '/' . $path;
291
+			$path = '/'.$path;
292 292
 		}
293 293
 		//remove duplicate slashes
294 294
 		while (strpos($path, '//') !== false) {
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 	 */
309 309
 	public function isValidPath($path) {
310 310
 		if (!$path || $path[0] !== '/') {
311
-			$path = '/' . $path;
311
+			$path = '/'.$path;
312 312
 		}
313 313
 		if (strstr($path, '/../') || strrchr($path, '/') === '/..') {
314 314
 			return false;
@@ -389,14 +389,14 @@  discard block
 block discarded – undo
389 389
 			$this->root->emit('\OC\Files', 'preCopy', [$this, $nonExisting]);
390 390
 			$this->root->emit('\OC\Files', 'preWrite', [$nonExisting]);
391 391
 			if (!$this->view->copy($this->path, $targetPath)) {
392
-				throw new NotPermittedException('Could not copy ' . $this->path . ' to ' . $targetPath);
392
+				throw new NotPermittedException('Could not copy '.$this->path.' to '.$targetPath);
393 393
 			}
394 394
 			$targetNode = $this->root->get($targetPath);
395 395
 			$this->root->emit('\OC\Files', 'postCopy', [$this, $targetNode]);
396 396
 			$this->root->emit('\OC\Files', 'postWrite', [$targetNode]);
397 397
 			return $targetNode;
398 398
 		} else {
399
-			throw new NotPermittedException('No permission to copy to path ' . $targetPath);
399
+			throw new NotPermittedException('No permission to copy to path '.$targetPath);
400 400
 		}
401 401
 	}
402 402
 
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 			$this->root->emit('\OC\Files', 'preRename', [$this, $nonExisting]);
414 414
 			$this->root->emit('\OC\Files', 'preWrite', [$nonExisting]);
415 415
 			if (!$this->view->rename($this->path, $targetPath)) {
416
-				throw new NotPermittedException('Could not move ' . $this->path . ' to ' . $targetPath);
416
+				throw new NotPermittedException('Could not move '.$this->path.' to '.$targetPath);
417 417
 			}
418 418
 			$targetNode = $this->root->get($targetPath);
419 419
 			$this->root->emit('\OC\Files', 'postRename', [$this, $targetNode]);
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 			$this->path = $targetPath;
422 422
 			return $targetNode;
423 423
 		} else {
424
-			throw new NotPermittedException('No permission to move to path ' . $targetPath);
424
+			throw new NotPermittedException('No permission to move to path '.$targetPath);
425 425
 		}
426 426
 	}
427 427
 
Please login to merge, or discard this patch.
lib/private/Files/Mount/CacheMountProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,13 +55,13 @@
 block discarded – undo
55 55
 	public function getMountsForUser(IUser $user, IStorageFactory $loader) {
56 56
 		$cacheBaseDir = $this->config->getSystemValue('cache_path', '');
57 57
 		if ($cacheBaseDir !== '') {
58
-			$cacheDir = rtrim($cacheBaseDir, '/') . '/' . $user->getUID();
58
+			$cacheDir = rtrim($cacheBaseDir, '/').'/'.$user->getUID();
59 59
 			if (!file_exists($cacheDir)) {
60 60
 				mkdir($cacheDir, 0770, true);
61 61
 			}
62 62
 
63 63
 			return [
64
-				new MountPoint('\OC\Files\Storage\Local', '/' . $user->getUID() . '/cache', ['datadir' => $cacheDir, $loader])
64
+				new MountPoint('\OC\Files\Storage\Local', '/'.$user->getUID().'/cache', ['datadir' => $cacheDir, $loader])
65 65
 			];
66 66
 		} else {
67 67
 			return [];
Please login to merge, or discard this patch.
lib/private/Files/Mount/ObjectHomeMountProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 			return null;
65 65
 		}
66 66
 
67
-		return new MountPoint('\OC\Files\ObjectStore\HomeObjectStoreStorage', '/' . $user->getUID(), $config['arguments'], $loader);
67
+		return new MountPoint('\OC\Files\ObjectStore\HomeObjectStoreStorage', '/'.$user->getUID(), $config['arguments'], $loader);
68 68
 	}
69 69
 
70 70
 	/**
Please login to merge, or discard this patch.
lib/private/Files/Mount/MountPoint.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		} else {
106 106
 			// Update old classes to new namespace
107 107
 			if (strpos($storage, 'OC_Filestorage_') !== false) {
108
-				$storage = '\OC\Files\Storage\\' . substr($storage, 15);
108
+				$storage = '\OC\Files\Storage\\'.substr($storage, 15);
109 109
 			}
110 110
 			$this->class = $storage;
111 111
 			$this->arguments = $arguments;
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 				return;
158 158
 			}
159 159
 		} else {
160
-			\OCP\Util::writeLog('core', 'storage backend ' . $this->class . ' not found', \OCP\Util::ERROR);
160
+			\OCP\Util::writeLog('core', 'storage backend '.$this->class.' not found', \OCP\Util::ERROR);
161 161
 			$this->invalidStorage = true;
162 162
 			return;
163 163
 		}
@@ -207,13 +207,13 @@  discard block
 block discarded – undo
207 207
 	 */
208 208
 	public function getInternalPath($path) {
209 209
 		$path = Filesystem::normalizePath($path, true, false, true);
210
-		if ($this->mountPoint === $path or $this->mountPoint . '/' === $path) {
210
+		if ($this->mountPoint === $path or $this->mountPoint.'/' === $path) {
211 211
 			$internalPath = '';
212 212
 		} else {
213 213
 			$internalPath = substr($path, strlen($this->mountPoint));
214 214
 		}
215 215
 		// substr returns false instead of an empty string, we always want a string
216
-		return (string)$internalPath;
216
+		return (string) $internalPath;
217 217
 	}
218 218
 
219 219
 	/**
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 	 */
267 267
 	public function getStorageRootId() {
268 268
 		if (is_null($this->rootId)) {
269
-			$this->rootId = (int)$this->getStorage()->getCache()->getId('');
269
+			$this->rootId = (int) $this->getStorage()->getCache()->getId('');
270 270
 		}
271 271
 		return $this->rootId;
272 272
 	}
Please login to merge, or discard this patch.
lib/private/Files/Mount/LocalHomeMountProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,6 +39,6 @@
 block discarded – undo
39 39
 	 */
40 40
 	public function getHomeMountForUser(IUser $user, IStorageFactory $loader) {
41 41
 		$arguments = ['user' => $user];
42
-		return new MountPoint('\OC\Files\Storage\Home', '/' . $user->getUID(), $arguments, $loader);
42
+		return new MountPoint('\OC\Files\Storage\Home', '/'.$user->getUID(), $arguments, $loader);
43 43
 	}
44 44
 }
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
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 	 * @param string $mountPoint
58 58
 	 * @param string $target
59 59
 	 */
60
-	public function moveMount($mountPoint, $target){
60
+	public function moveMount($mountPoint, $target) {
61 61
 		$this->mounts[$target] = $this->mounts[$mountPoint];
62 62
 		unset($this->mounts[$mountPoint]);
63 63
 	}
Please login to merge, or discard this patch.
lib/private/Files/AppData/AppData.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 				throw new \RuntimeException('no instance id!');
74 74
 			}
75 75
 
76
-			$name = 'appdata_' . $instanceId;
76
+			$name = 'appdata_'.$instanceId;
77 77
 
78 78
 			try {
79 79
 				$appDataFolder = $this->rootFolder->get($name);
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 				try {
92 92
 					$appDataFolder = $appDataFolder->newFolder($this->appId);
93 93
 				} catch (NotPermittedException $e) {
94
-					throw new \RuntimeException('Could not get appdata folder for ' . $this->appId);
94
+					throw new \RuntimeException('Could not get appdata folder for '.$this->appId);
95 95
 				}
96 96
 			}
97 97
 
Please login to merge, or discard this patch.
lib/private/Files/Filesystem.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -409,17 +409,17 @@  discard block
 block discarded – undo
409 409
 		$userObject = $userManager->get($user);
410 410
 
411 411
 		if (is_null($userObject)) {
412
-			\OCP\Util::writeLog('files', ' Backends provided no user object for ' . $user, \OCP\Util::ERROR);
412
+			\OCP\Util::writeLog('files', ' Backends provided no user object for '.$user, \OCP\Util::ERROR);
413 413
 			// reset flag, this will make it possible to rethrow the exception if called again
414 414
 			unset(self::$usersSetup[$user]);
415
-			throw new \OC\User\NoUserException('Backends provided no user object for ' . $user);
415
+			throw new \OC\User\NoUserException('Backends provided no user object for '.$user);
416 416
 		}
417 417
 
418 418
 		$realUid = $userObject->getUID();
419 419
 		// workaround in case of different casings
420 420
 		if ($user !== $realUid) {
421 421
 			$stack = json_encode(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 50));
422
-			\OCP\Util::writeLog('files', 'initMountPoints() called with wrong user casing. This could be a bug. Expected: "' . $realUid . '" got "' . $user . '". Stack: ' . $stack, \OCP\Util::WARN);
422
+			\OCP\Util::writeLog('files', 'initMountPoints() called with wrong user casing. This could be a bug. Expected: "'.$realUid.'" got "'.$user.'". Stack: '.$stack, \OCP\Util::WARN);
423 423
 			$user = $realUid;
424 424
 
425 425
 			// again with the correct casing
@@ -453,11 +453,11 @@  discard block
 block discarded – undo
453 453
 		} else {
454 454
 			self::getMountManager()->addMount(new MountPoint(
455 455
 				new NullStorage([]),
456
-				'/' . $user
456
+				'/'.$user
457 457
 			));
458 458
 			self::getMountManager()->addMount(new MountPoint(
459 459
 				new NullStorage([]),
460
-				'/' . $user . '/files'
460
+				'/'.$user.'/files'
461 461
 			));
462 462
 		}
463 463
 		\OC_Hook::emit('OC_Filesystem', 'post_initMountPoints', array('user' => $user));
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 	private static function listenForNewMountProviders(MountProviderCollection $mountConfigManager, IUserManager $userManager) {
473 473
 		if (!self::$listeningForProviders) {
474 474
 			self::$listeningForProviders = true;
475
-			$mountConfigManager->listen('\OC\Files\Config', 'registerMountProvider', function (IMountProvider $provider) use ($userManager) {
475
+			$mountConfigManager->listen('\OC\Files\Config', 'registerMountProvider', function(IMountProvider $provider) use ($userManager) {
476 476
 				foreach (Filesystem::$usersSetup as $user => $setup) {
477 477
 					$userObject = $userManager->get($user);
478 478
 					if ($userObject) {
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 	 * @return string
568 568
 	 */
569 569
 	static public function getLocalPath($path) {
570
-		$datadir = \OC_User::getHome(\OC_User::getUser()) . '/files';
570
+		$datadir = \OC_User::getHome(\OC_User::getUser()).'/files';
571 571
 		$newpath = $path;
572 572
 		if (strncmp($newpath, $datadir, strlen($datadir)) == 0) {
573 573
 			$newpath = substr($path, strlen($datadir));
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 	static public function isValidPath($path) {
585 585
 		$path = self::normalizePath($path);
586 586
 		if (!$path || $path[0] !== '/') {
587
-			$path = '/' . $path;
587
+			$path = '/'.$path;
588 588
 		}
589 589
 		if (strpos($path, '/../') !== false || strrchr($path, '/') === '/..') {
590 590
 			return false;
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
 		 *        conversion should get removed as soon as all existing
814 814
 		 *        function calls have been fixed.
815 815
 		 */
816
-		$path = (string)$path;
816
+		$path = (string) $path;
817 817
 
818 818
 		$cacheKey = json_encode([$path, $stripTrailingSlash, $isAbsolutePath, $keepUnicode]);
819 819
 
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
 
836 836
 		//add leading slash
837 837
 		if ($path[0] !== '/') {
838
-			$path = '/' . $path;
838
+			$path = '/'.$path;
839 839
 		}
840 840
 
841 841
 		// remove '/./'
Please login to merge, or discard this patch.