Passed
Push — master ( 927582...173f8a )
by Morris
11:22 queued 17s
created
apps/files_trashbin/lib/Trashbin.php 1 patch
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 		Filesystem::initMountPoints($uid);
107 107
 		if ($uid !== User::getUser()) {
108 108
 			$info = Filesystem::getFileInfo($filename);
109
-			$ownerView = new View('/' . $uid . '/files');
109
+			$ownerView = new View('/'.$uid.'/files');
110 110
 			try {
111 111
 				$filename = $ownerView->getPath($info['fileid']);
112 112
 			} catch (NotFoundException $e) {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	}
158 158
 
159 159
 	private static function setUpTrash($user) {
160
-		$view = new View('/' . $user);
160
+		$view = new View('/'.$user);
161 161
 		if (!$view->is_dir('files_trashbin')) {
162 162
 			$view->mkdir('files_trashbin');
163 163
 		}
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
 
193 193
 		$view = new View('/');
194 194
 
195
-		$target = $user . '/files_trashbin/files/' . $targetFilename . '.d' . $timestamp;
196
-		$source = $owner . '/files_trashbin/files/' . $sourceFilename . '.d' . $timestamp;
195
+		$target = $user.'/files_trashbin/files/'.$targetFilename.'.d'.$timestamp;
196
+		$source = $owner.'/files_trashbin/files/'.$sourceFilename.'.d'.$timestamp;
197 197
 		$free = $view->free_space($target);
198 198
 		$isUnknownOrUnlimitedFreeSpace = $free < 0;
199 199
 		$isEnoughFreeSpaceLeft = $view->filesize($source) < $free;
@@ -232,9 +232,9 @@  discard block
 block discarded – undo
232 232
 			$ownerPath = $file_path;
233 233
 		}
234 234
 
235
-		$ownerView = new View('/' . $owner);
235
+		$ownerView = new View('/'.$owner);
236 236
 		// file has been deleted in between
237
-		if (is_null($ownerPath) || $ownerPath === '' || !$ownerView->file_exists('/files/' . $ownerPath)) {
237
+		if (is_null($ownerPath) || $ownerPath === '' || !$ownerView->file_exists('/files/'.$ownerPath)) {
238 238
 			return true;
239 239
 		}
240 240
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 		$lockingProvider = \OC::$server->getLockingProvider();
256 256
 
257 257
 		// disable proxy to prevent recursive calls
258
-		$trashPath = '/files_trashbin/files/' . $filename . '.d' . $timestamp;
258
+		$trashPath = '/files_trashbin/files/'.$filename.'.d'.$timestamp;
259 259
 		$gotLock = false;
260 260
 
261 261
 		while (!$gotLock) {
@@ -271,12 +271,12 @@  discard block
 block discarded – undo
271 271
 
272 272
 				$timestamp = $timestamp + 1;
273 273
 
274
-				$trashPath = '/files_trashbin/files/' . $filename . '.d' . $timestamp;
274
+				$trashPath = '/files_trashbin/files/'.$filename.'.d'.$timestamp;
275 275
 			}
276 276
 		}
277 277
 
278 278
 		/** @var \OC\Files\Storage\Storage $sourceStorage */
279
-		[$sourceStorage, $sourceInternalPath] = $ownerView->resolvePath('/files/' . $ownerPath);
279
+		[$sourceStorage, $sourceInternalPath] = $ownerView->resolvePath('/files/'.$ownerPath);
280 280
 
281 281
 		$connection = \OC::$server->getDatabaseConnection();
282 282
 		$connection->beginTransaction();
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 			if ($trashStorage->file_exists($trashInternalPath)) {
294 294
 				$trashStorage->unlink($trashInternalPath);
295 295
 			}
296
-			\OC::$server->getLogger()->error('Couldn\'t move ' . $file_path . ' to the trash bin', ['app' => 'files_trashbin']);
296
+			\OC::$server->getLogger()->error('Couldn\'t move '.$file_path.' to the trash bin', ['app' => 'files_trashbin']);
297 297
 		}
298 298
 
299 299
 		if ($sourceStorage->file_exists($sourceInternalPath)) { // failed to delete the original file, abort
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 				\OC::$server->getLogger()->error('trash bin database couldn\'t be updated', ['app' => 'files_trashbin']);
316 316
 			}
317 317
 			\OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_moveToTrash', ['filePath' => Filesystem::normalizePath($file_path),
318
-				'trashPath' => Filesystem::normalizePath($filename . '.d' . $timestamp)]);
318
+				'trashPath' => Filesystem::normalizePath($filename.'.d'.$timestamp)]);
319 319
 
320 320
 			self::retainVersions($filename, $owner, $ownerPath, $timestamp);
321 321
 
@@ -350,17 +350,17 @@  discard block
 block discarded – undo
350 350
 			$user = User::getUser();
351 351
 			$rootView = new View('/');
352 352
 
353
-			if ($rootView->is_dir($owner . '/files_versions/' . $ownerPath)) {
353
+			if ($rootView->is_dir($owner.'/files_versions/'.$ownerPath)) {
354 354
 				if ($owner !== $user) {
355
-					self::copy_recursive($owner . '/files_versions/' . $ownerPath, $owner . '/files_trashbin/versions/' . basename($ownerPath) . '.d' . $timestamp, $rootView);
355
+					self::copy_recursive($owner.'/files_versions/'.$ownerPath, $owner.'/files_trashbin/versions/'.basename($ownerPath).'.d'.$timestamp, $rootView);
356 356
 				}
357
-				self::move($rootView, $owner . '/files_versions/' . $ownerPath, $user . '/files_trashbin/versions/' . $filename . '.d' . $timestamp);
357
+				self::move($rootView, $owner.'/files_versions/'.$ownerPath, $user.'/files_trashbin/versions/'.$filename.'.d'.$timestamp);
358 358
 			} elseif ($versions = \OCA\Files_Versions\Storage::getVersions($owner, $ownerPath)) {
359 359
 				foreach ($versions as $v) {
360 360
 					if ($owner !== $user) {
361
-						self::copy($rootView, $owner . '/files_versions' . $v['path'] . '.v' . $v['version'], $owner . '/files_trashbin/versions/' . $v['name'] . '.v' . $v['version'] . '.d' . $timestamp);
361
+						self::copy($rootView, $owner.'/files_versions'.$v['path'].'.v'.$v['version'], $owner.'/files_trashbin/versions/'.$v['name'].'.v'.$v['version'].'.d'.$timestamp);
362 362
 					}
363
-					self::move($rootView, $owner . '/files_versions' . $v['path'] . '.v' . $v['version'], $user . '/files_trashbin/versions/' . $filename . '.v' . $v['version'] . '.d' . $timestamp);
363
+					self::move($rootView, $owner.'/files_versions'.$v['path'].'.v'.$v['version'], $user.'/files_trashbin/versions/'.$filename.'.v'.$v['version'].'.d'.$timestamp);
364 364
 				}
365 365
 			}
366 366
 		}
@@ -422,18 +422,18 @@  discard block
 block discarded – undo
422 422
 	 */
423 423
 	public static function restore($file, $filename, $timestamp) {
424 424
 		$user = User::getUser();
425
-		$view = new View('/' . $user);
425
+		$view = new View('/'.$user);
426 426
 
427 427
 		$location = '';
428 428
 		if ($timestamp) {
429 429
 			$location = self::getLocation($user, $filename, $timestamp);
430 430
 			if ($location === false) {
431
-				\OC::$server->getLogger()->error('trash bin database inconsistent! ($user: ' . $user . ' $filename: ' . $filename . ', $timestamp: ' . $timestamp . ')', ['app' => 'files_trashbin']);
431
+				\OC::$server->getLogger()->error('trash bin database inconsistent! ($user: '.$user.' $filename: '.$filename.', $timestamp: '.$timestamp.')', ['app' => 'files_trashbin']);
432 432
 			} else {
433 433
 				// if location no longer exists, restore file in the root directory
434 434
 				if ($location !== '/' &&
435
-					(!$view->is_dir('files/' . $location) ||
436
-						!$view->isCreatable('files/' . $location))
435
+					(!$view->is_dir('files/'.$location) ||
436
+						!$view->isCreatable('files/'.$location))
437 437
 				) {
438 438
 					$location = '';
439 439
 				}
@@ -443,8 +443,8 @@  discard block
 block discarded – undo
443 443
 		// we need a  extension in case a file/dir with the same name already exists
444 444
 		$uniqueFilename = self::getUniqueFilename($location, $filename, $view);
445 445
 
446
-		$source = Filesystem::normalizePath('files_trashbin/files/' . $file);
447
-		$target = Filesystem::normalizePath('files/' . $location . '/' . $uniqueFilename);
446
+		$source = Filesystem::normalizePath('files_trashbin/files/'.$file);
447
+		$target = Filesystem::normalizePath('files/'.$location.'/'.$uniqueFilename);
448 448
 		if (!$view->file_exists($source)) {
449 449
 			return false;
450 450
 		}
@@ -459,10 +459,10 @@  discard block
 block discarded – undo
459 459
 		// handle the restore result
460 460
 		if ($restoreResult) {
461 461
 			$fakeRoot = $view->getRoot();
462
-			$view->chroot('/' . $user . '/files');
463
-			$view->touch('/' . $location . '/' . $uniqueFilename, $mtime);
462
+			$view->chroot('/'.$user.'/files');
463
+			$view->touch('/'.$location.'/'.$uniqueFilename, $mtime);
464 464
 			$view->chroot($fakeRoot);
465
-			\OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', ['filePath' => Filesystem::normalizePath('/' . $location . '/' . $uniqueFilename),
465
+			\OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', ['filePath' => Filesystem::normalizePath('/'.$location.'/'.$uniqueFilename),
466 466
 				'trashPath' => Filesystem::normalizePath($file)]);
467 467
 
468 468
 			self::restoreVersions($view, $file, $filename, $uniqueFilename, $location, $timestamp);
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 			$user = User::getUser();
495 495
 			$rootView = new View('/');
496 496
 
497
-			$target = Filesystem::normalizePath('/' . $location . '/' . $uniqueFilename);
497
+			$target = Filesystem::normalizePath('/'.$location.'/'.$uniqueFilename);
498 498
 
499 499
 			[$owner, $ownerPath] = self::getUidAndFilename($target);
500 500
 
@@ -509,14 +509,14 @@  discard block
 block discarded – undo
509 509
 				$versionedFile = $file;
510 510
 			}
511 511
 
512
-			if ($view->is_dir('/files_trashbin/versions/' . $file)) {
513
-				$rootView->rename(Filesystem::normalizePath($user . '/files_trashbin/versions/' . $file), Filesystem::normalizePath($owner . '/files_versions/' . $ownerPath));
512
+			if ($view->is_dir('/files_trashbin/versions/'.$file)) {
513
+				$rootView->rename(Filesystem::normalizePath($user.'/files_trashbin/versions/'.$file), Filesystem::normalizePath($owner.'/files_versions/'.$ownerPath));
514 514
 			} elseif ($versions = self::getVersionsFromTrash($versionedFile, $timestamp, $user)) {
515 515
 				foreach ($versions as $v) {
516 516
 					if ($timestamp) {
517
-						$rootView->rename($user . '/files_trashbin/versions/' . $versionedFile . '.v' . $v . '.d' . $timestamp, $owner . '/files_versions/' . $ownerPath . '.v' . $v);
517
+						$rootView->rename($user.'/files_trashbin/versions/'.$versionedFile.'.v'.$v.'.d'.$timestamp, $owner.'/files_versions/'.$ownerPath.'.v'.$v);
518 518
 					} else {
519
-						$rootView->rename($user . '/files_trashbin/versions/' . $versionedFile . '.v' . $v, $owner . '/files_versions/' . $ownerPath . '.v' . $v);
519
+						$rootView->rename($user.'/files_trashbin/versions/'.$versionedFile.'.v'.$v, $owner.'/files_versions/'.$ownerPath.'.v'.$v);
520 520
 					}
521 521
 				}
522 522
 			}
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 	public static function deleteAll() {
530 530
 		$user = User::getUser();
531 531
 		$userRoot = \OC::$server->getUserFolder($user)->getParent();
532
-		$view = new View('/' . $user);
532
+		$view = new View('/'.$user);
533 533
 		$fileInfos = $view->getDirectoryContent('files_trashbin/files');
534 534
 
535 535
 		try {
@@ -601,13 +601,13 @@  discard block
 block discarded – undo
601 601
 	 */
602 602
 	public static function delete($filename, $user, $timestamp = null) {
603 603
 		$userRoot = \OC::$server->getUserFolder($user)->getParent();
604
-		$view = new View('/' . $user);
604
+		$view = new View('/'.$user);
605 605
 		$size = 0;
606 606
 
607 607
 		if ($timestamp) {
608 608
 			$query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=? AND `id`=? AND `timestamp`=?');
609 609
 			$query->execute([$user, $filename, $timestamp]);
610
-			$file = $filename . '.d' . $timestamp;
610
+			$file = $filename.'.d'.$timestamp;
611 611
 		} else {
612 612
 			$file = $filename;
613 613
 		}
@@ -615,20 +615,20 @@  discard block
 block discarded – undo
615 615
 		$size += self::deleteVersions($view, $file, $filename, $timestamp, $user);
616 616
 
617 617
 		try {
618
-			$node = $userRoot->get('/files_trashbin/files/' . $file);
618
+			$node = $userRoot->get('/files_trashbin/files/'.$file);
619 619
 		} catch (NotFoundException $e) {
620 620
 			return $size;
621 621
 		}
622 622
 
623 623
 		if ($node instanceof Folder) {
624
-			$size += self::calculateSize(new View('/' . $user . '/files_trashbin/files/' . $file));
624
+			$size += self::calculateSize(new View('/'.$user.'/files_trashbin/files/'.$file));
625 625
 		} elseif ($node instanceof File) {
626
-			$size += $view->filesize('/files_trashbin/files/' . $file);
626
+			$size += $view->filesize('/files_trashbin/files/'.$file);
627 627
 		}
628 628
 
629
-		self::emitTrashbinPreDelete('/files_trashbin/files/' . $file);
629
+		self::emitTrashbinPreDelete('/files_trashbin/files/'.$file);
630 630
 		$node->delete();
631
-		self::emitTrashbinPostDelete('/files_trashbin/files/' . $file);
631
+		self::emitTrashbinPostDelete('/files_trashbin/files/'.$file);
632 632
 
633 633
 		return $size;
634 634
 	}
@@ -644,17 +644,17 @@  discard block
 block discarded – undo
644 644
 	private static function deleteVersions(View $view, $file, $filename, $timestamp, $user) {
645 645
 		$size = 0;
646 646
 		if (\OCP\App::isEnabled('files_versions')) {
647
-			if ($view->is_dir('files_trashbin/versions/' . $file)) {
648
-				$size += self::calculateSize(new View('/' . $user . '/files_trashbin/versions/' . $file));
649
-				$view->unlink('files_trashbin/versions/' . $file);
647
+			if ($view->is_dir('files_trashbin/versions/'.$file)) {
648
+				$size += self::calculateSize(new View('/'.$user.'/files_trashbin/versions/'.$file));
649
+				$view->unlink('files_trashbin/versions/'.$file);
650 650
 			} elseif ($versions = self::getVersionsFromTrash($filename, $timestamp, $user)) {
651 651
 				foreach ($versions as $v) {
652 652
 					if ($timestamp) {
653
-						$size += $view->filesize('/files_trashbin/versions/' . $filename . '.v' . $v . '.d' . $timestamp);
654
-						$view->unlink('/files_trashbin/versions/' . $filename . '.v' . $v . '.d' . $timestamp);
653
+						$size += $view->filesize('/files_trashbin/versions/'.$filename.'.v'.$v.'.d'.$timestamp);
654
+						$view->unlink('/files_trashbin/versions/'.$filename.'.v'.$v.'.d'.$timestamp);
655 655
 					} else {
656
-						$size += $view->filesize('/files_trashbin/versions/' . $filename . '.v' . $v);
657
-						$view->unlink('/files_trashbin/versions/' . $filename . '.v' . $v);
656
+						$size += $view->filesize('/files_trashbin/versions/'.$filename.'.v'.$v);
657
+						$view->unlink('/files_trashbin/versions/'.$filename.'.v'.$v);
658 658
 					}
659 659
 				}
660 660
 			}
@@ -671,13 +671,13 @@  discard block
 block discarded – undo
671 671
 	 */
672 672
 	public static function file_exists($filename, $timestamp = null) {
673 673
 		$user = User::getUser();
674
-		$view = new View('/' . $user);
674
+		$view = new View('/'.$user);
675 675
 
676 676
 		if ($timestamp) {
677
-			$filename = $filename . '.d' . $timestamp;
677
+			$filename = $filename.'.d'.$timestamp;
678 678
 		}
679 679
 
680
-		$target = Filesystem::normalizePath('files_trashbin/files/' . $filename);
680
+		$target = Filesystem::normalizePath('files_trashbin/files/'.$filename);
681 681
 		return $view->file_exists($target);
682 682
 	}
683 683
 
@@ -701,8 +701,8 @@  discard block
 block discarded – undo
701 701
 	 */
702 702
 	private static function calculateFreeSpace($trashbinSize, $user) {
703 703
 		$config = \OC::$server->getConfig();
704
-		$systemTrashbinSize = (int)$config->getAppValue('files_trashbin', 'trashbin_size', '-1');
705
-		$userTrashbinSize = (int)$config->getUserValue($user, 'files_trashbin', 'trashbin_size', '-1');
704
+		$systemTrashbinSize = (int) $config->getAppValue('files_trashbin', 'trashbin_size', '-1');
705
+		$userTrashbinSize = (int) $config->getUserValue($user, 'files_trashbin', 'trashbin_size', '-1');
706 706
 		$configuredTrashbinSize = ($userTrashbinSize < 0) ? $systemTrashbinSize : $userTrashbinSize;
707 707
 		if ($configuredTrashbinSize) {
708 708
 			return $configuredTrashbinSize - $trashbinSize;
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
 			foreach ($files as $file) {
813 813
 				if ($availableSpace < 0 && $expiration->isExpired($file['mtime'], true)) {
814 814
 					$tmp = self::delete($file['name'], $user, $file['mtime']);
815
-					\OC::$server->getLogger()->info('remove "' . $file['name'] . '" (' . $tmp . 'B) to meet the limit of trash bin size (50% of available quota)', ['app' => 'files_trashbin']);
815
+					\OC::$server->getLogger()->info('remove "'.$file['name'].'" ('.$tmp.'B) to meet the limit of trash bin size (50% of available quota)', ['app' => 'files_trashbin']);
816 816
 					$availableSpace += $tmp;
817 817
 					$size += $tmp;
818 818
 				} else {
@@ -843,10 +843,10 @@  discard block
 block discarded – undo
843 843
 					$size += self::delete($filename, $user, $timestamp);
844 844
 					$count++;
845 845
 				} catch (\OCP\Files\NotPermittedException $e) {
846
-					\OC::$server->getLogger()->logException($e, ['app' => 'files_trashbin', 'level' => \OCP\ILogger::WARN, 'message' => 'Removing "' . $filename . '" from trashbin failed.']);
846
+					\OC::$server->getLogger()->logException($e, ['app' => 'files_trashbin', 'level' => \OCP\ILogger::WARN, 'message' => 'Removing "'.$filename.'" from trashbin failed.']);
847 847
 				}
848 848
 				\OC::$server->getLogger()->info(
849
-					'Remove "' . $filename . '" from trashbin because it exceeds max retention obligation term.',
849
+					'Remove "'.$filename.'" from trashbin because it exceeds max retention obligation term.',
850 850
 					['app' => 'files_trashbin']
851 851
 				);
852 852
 			} else {
@@ -872,16 +872,16 @@  discard block
 block discarded – undo
872 872
 			$view->mkdir($destination);
873 873
 			$view->touch($destination, $view->filemtime($source));
874 874
 			foreach ($view->getDirectoryContent($source) as $i) {
875
-				$pathDir = $source . '/' . $i['name'];
875
+				$pathDir = $source.'/'.$i['name'];
876 876
 				if ($view->is_dir($pathDir)) {
877
-					$size += self::copy_recursive($pathDir, $destination . '/' . $i['name'], $view);
877
+					$size += self::copy_recursive($pathDir, $destination.'/'.$i['name'], $view);
878 878
 				} else {
879 879
 					$size += $view->filesize($pathDir);
880
-					$result = $view->copy($pathDir, $destination . '/' . $i['name']);
880
+					$result = $view->copy($pathDir, $destination.'/'.$i['name']);
881 881
 					if (!$result) {
882 882
 						throw new \OCA\Files_Trashbin\Exceptions\CopyRecursiveException();
883 883
 					}
884
-					$view->touch($destination . '/' . $i['name'], $view->filemtime($pathDir));
884
+					$view->touch($destination.'/'.$i['name'], $view->filemtime($pathDir));
885 885
 				}
886 886
 			}
887 887
 		} else {
@@ -903,23 +903,23 @@  discard block
 block discarded – undo
903 903
 	 * @return array
904 904
 	 */
905 905
 	private static function getVersionsFromTrash($filename, $timestamp, $user) {
906
-		$view = new View('/' . $user . '/files_trashbin/versions');
906
+		$view = new View('/'.$user.'/files_trashbin/versions');
907 907
 		$versions = [];
908 908
 
909 909
 		//force rescan of versions, local storage may not have updated the cache
910 910
 		if (!self::$scannedVersions) {
911 911
 			/** @var \OC\Files\Storage\Storage $storage */
912
-			[$storage,] = $view->resolvePath('/');
912
+			[$storage, ] = $view->resolvePath('/');
913 913
 			$storage->getScanner()->scan('files_trashbin/versions');
914 914
 			self::$scannedVersions = true;
915 915
 		}
916 916
 
917 917
 		if ($timestamp) {
918 918
 			// fetch for old versions
919
-			$matches = $view->searchRaw($filename . '.v%.d' . $timestamp);
919
+			$matches = $view->searchRaw($filename.'.v%.d'.$timestamp);
920 920
 			$offset = -strlen($timestamp) - 2;
921 921
 		} else {
922
-			$matches = $view->searchRaw($filename . '.v%');
922
+			$matches = $view->searchRaw($filename.'.v%');
923 923
 		}
924 924
 
925 925
 		if (is_array($matches)) {
@@ -949,18 +949,18 @@  discard block
 block discarded – undo
949 949
 		$name = pathinfo($filename, PATHINFO_FILENAME);
950 950
 		$l = \OC::$server->getL10N('files_trashbin');
951 951
 
952
-		$location = '/' . trim($location, '/');
952
+		$location = '/'.trim($location, '/');
953 953
 
954 954
 		// if extension is not empty we set a dot in front of it
955 955
 		if ($ext !== '') {
956
-			$ext = '.' . $ext;
956
+			$ext = '.'.$ext;
957 957
 		}
958 958
 
959
-		if ($view->file_exists('files' . $location . '/' . $filename)) {
959
+		if ($view->file_exists('files'.$location.'/'.$filename)) {
960 960
 			$i = 2;
961
-			$uniqueName = $name . " (" . $l->t("restored") . ")" . $ext;
962
-			while ($view->file_exists('files' . $location . '/' . $uniqueName)) {
963
-				$uniqueName = $name . " (" . $l->t("restored") . " " . $i . ")" . $ext;
961
+			$uniqueName = $name." (".$l->t("restored").")".$ext;
962
+			while ($view->file_exists('files'.$location.'/'.$uniqueName)) {
963
+				$uniqueName = $name." (".$l->t("restored")." ".$i.")".$ext;
964 964
 				$i++;
965 965
 			}
966 966
 
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
 	 * @return integer size of the folder
978 978
 	 */
979 979
 	private static function calculateSize($view) {
980
-		$root = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . $view->getAbsolutePath('');
980
+		$root = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').$view->getAbsolutePath('');
981 981
 		if (!file_exists($root)) {
982 982
 			return 0;
983 983
 		}
@@ -1008,7 +1008,7 @@  discard block
 block discarded – undo
1008 1008
 	 * @return integer trash bin size
1009 1009
 	 */
1010 1010
 	private static function getTrashbinSize($user) {
1011
-		$view = new View('/' . $user);
1011
+		$view = new View('/'.$user);
1012 1012
 		$fileInfo = $view->getFileInfo('/files_trashbin');
1013 1013
 		return isset($fileInfo['size']) ? $fileInfo['size'] : 0;
1014 1014
 	}
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
 	 * @return bool
1035 1035
 	 */
1036 1036
 	public static function isEmpty($user) {
1037
-		$view = new View('/' . $user . '/files_trashbin');
1037
+		$view = new View('/'.$user.'/files_trashbin');
1038 1038
 		if ($view->is_dir('/files') && $dh = $view->opendir('/files')) {
1039 1039
 			while ($file = readdir($dh)) {
1040 1040
 				if (!Filesystem::isIgnoredDir($file)) {
Please login to merge, or discard this patch.
lib/private/Files/Storage/Local.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 			$this->realDataDir = $this->datadir;
71 71
 		} else {
72 72
 			$realPath = realpath($this->datadir) ?: $this->datadir;
73
-			$this->realDataDir = rtrim($realPath, '/') . '/';
73
+			$this->realDataDir = rtrim($realPath, '/').'/';
74 74
 		}
75 75
 		if (substr($this->datadir, -1) !== '/') {
76 76
 			$this->datadir .= '/';
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	}
83 83
 
84 84
 	public function getId() {
85
-		return 'local::' . $this->datadir;
85
+		return 'local::'.$this->datadir;
86 86
 	}
87 87
 
88 88
 	public function mkdir($path) {
@@ -301,17 +301,17 @@  discard block
 block discarded – undo
301 301
 		$dstParent = dirname($path2);
302 302
 
303 303
 		if (!$this->isUpdatable($srcParent)) {
304
-			\OCP\Util::writeLog('core', 'unable to rename, source directory is not writable : ' . $srcParent, ILogger::ERROR);
304
+			\OCP\Util::writeLog('core', 'unable to rename, source directory is not writable : '.$srcParent, ILogger::ERROR);
305 305
 			return false;
306 306
 		}
307 307
 
308 308
 		if (!$this->isUpdatable($dstParent)) {
309
-			\OCP\Util::writeLog('core', 'unable to rename, destination directory is not writable : ' . $dstParent, ILogger::ERROR);
309
+			\OCP\Util::writeLog('core', 'unable to rename, destination directory is not writable : '.$dstParent, ILogger::ERROR);
310 310
 			return false;
311 311
 		}
312 312
 
313 313
 		if (!$this->file_exists($path1)) {
314
-			\OCP\Util::writeLog('core', 'unable to rename, file does not exists : ' . $path1, ILogger::ERROR);
314
+			\OCP\Util::writeLog('core', 'unable to rename, file does not exists : '.$path1, ILogger::ERROR);
315 315
 			return false;
316 316
 		}
317 317
 
@@ -397,13 +397,13 @@  discard block
 block discarded – undo
397 397
 			if (\OC\Files\Filesystem::isIgnoredDir($item)) {
398 398
 				continue;
399 399
 			}
400
-			$physicalItem = $physicalDir . '/' . $item;
400
+			$physicalItem = $physicalDir.'/'.$item;
401 401
 
402 402
 			if (strstr(strtolower($item), strtolower($query)) !== false) {
403
-				$files[] = $dir . '/' . $item;
403
+				$files[] = $dir.'/'.$item;
404 404
 			}
405 405
 			if (is_dir($physicalItem)) {
406
-				$files = array_merge($files, $this->searchInDir($query, $dir . '/' . $item));
406
+				$files = array_merge($files, $this->searchInDir($query, $dir.'/'.$item));
407 407
 			}
408 408
 		}
409 409
 		return $files;
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 			throw new ForbiddenException('Invalid path', false);
437 437
 		}
438 438
 
439
-		$fullPath = $this->datadir . $path;
439
+		$fullPath = $this->datadir.$path;
440 440
 		$currentPath = $path;
441 441
 		if ($this->allowSymlinks || $currentPath === '') {
442 442
 			return $fullPath;
@@ -448,10 +448,10 @@  discard block
 block discarded – undo
448 448
 			if ($currentPath === '' || $currentPath === '.') {
449 449
 				return $fullPath;
450 450
 			}
451
-			$realPath = realpath($this->datadir . $currentPath);
451
+			$realPath = realpath($this->datadir.$currentPath);
452 452
 		}
453 453
 		if ($realPath) {
454
-			$realPath = $realPath . '/';
454
+			$realPath = $realPath.'/';
455 455
 		}
456 456
 		if (substr($realPath, 0, $this->dataDirLength) === $this->realDataDir) {
457 457
 			return $fullPath;
Please login to merge, or discard this patch.