Passed
Push — master ( 7ba632...8cab1d )
by Julius
27:04 queued 12:29
created
lib/private/Files/Storage/Common.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 		return $this->filetype($path) === 'file';
122 122
 	}
123 123
 
124
-	public function filesize($path): false|int|float {
124
+	public function filesize($path): false | int | float {
125 125
 		if ($this->is_dir($path)) {
126 126
 			return 0; //by definition
127 127
 		} else {
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 			$this->mkdir($target);
231 231
 			while ($file = readdir($dir)) {
232 232
 				if (!Filesystem::isIgnoredDir($file)) {
233
-					if (!$this->copy($source . '/' . $file, $target . '/' . $file)) {
233
+					if (!$this->copy($source.'/'.$file, $target.'/'.$file)) {
234 234
 						closedir($dir);
235 235
 						return false;
236 236
 					}
@@ -285,12 +285,12 @@  discard block
 block discarded – undo
285 285
 		if (is_resource($dh)) {
286 286
 			while (($file = readdir($dh)) !== false) {
287 287
 				if (!\OC\Files\Filesystem::isIgnoredDir($file)) {
288
-					if ($this->is_dir($path . '/' . $file)) {
289
-						mkdir($target . '/' . $file);
290
-						$this->addLocalFolder($path . '/' . $file, $target . '/' . $file);
288
+					if ($this->is_dir($path.'/'.$file)) {
289
+						mkdir($target.'/'.$file);
290
+						$this->addLocalFolder($path.'/'.$file, $target.'/'.$file);
291 291
 					} else {
292
-						$tmp = $this->toTmpFile($path . '/' . $file);
293
-						rename($tmp, $target . '/' . $file);
292
+						$tmp = $this->toTmpFile($path.'/'.$file);
293
+						rename($tmp, $target.'/'.$file);
294 294
 					}
295 295
 				}
296 296
 			}
@@ -311,10 +311,10 @@  discard block
 block discarded – undo
311 311
 					continue;
312 312
 				}
313 313
 				if (strstr(strtolower($item), strtolower($query)) !== false) {
314
-					$files[] = $dir . '/' . $item;
314
+					$files[] = $dir.'/'.$item;
315 315
 				}
316
-				if ($this->is_dir($dir . '/' . $item)) {
317
-					$files = array_merge($files, $this->searchInDir($query, $dir . '/' . $item));
316
+				if ($this->is_dir($dir.'/'.$item)) {
317
+					$files = array_merge($files, $this->searchInDir($query, $dir.'/'.$item));
318 318
 				}
319 319
 			}
320 320
 		}
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 		if (!isset($this->watcher)) {
366 366
 			$this->watcher = new Watcher($storage);
367 367
 			$globalPolicy = \OC::$server->getConfig()->getSystemValue('filesystem_check_changes', Watcher::CHECK_NEVER);
368
-			$this->watcher->setPolicy((int)$this->getMountOption('filesystem_check_changes', $globalPolicy));
368
+			$this->watcher->setPolicy((int) $this->getMountOption('filesystem_check_changes', $globalPolicy));
369 369
 		}
370 370
 		return $this->watcher;
371 371
 	}
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 		}
383 383
 		if (!isset($storage->propagator)) {
384 384
 			$config = \OC::$server->getSystemConfig();
385
-			$storage->propagator = new Propagator($storage, \OC::$server->getDatabaseConnection(), ['appdata_' . $config->getValue('instanceid')]);
385
+			$storage->propagator = new Propagator($storage, \OC::$server->getDatabaseConnection(), ['appdata_'.$config->getValue('instanceid')]);
386 386
 		}
387 387
 		return $storage->propagator;
388 388
 	}
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 	 */
441 441
 	public function cleanPath($path) {
442 442
 		if (strlen($path) == 0 or $path[0] != '/') {
443
-			$path = '/' . $path;
443
+			$path = '/'.$path;
444 444
 		}
445 445
 
446 446
 		$output = [];
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 			return false;
470 470
 		} catch (\Exception $e) {
471 471
 			\OC::$server->get(LoggerInterface::class)->warning(
472
-				"External storage not available: " . $e->getMessage(),
472
+				"External storage not available: ".$e->getMessage(),
473 473
 				['exception' => $e]
474 474
 			);
475 475
 			return false;
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 				$result = true;
624 624
 				while ($result and ($file = readdir($dh)) !== false) {
625 625
 					if (!Filesystem::isIgnoredDir($file)) {
626
-						$result &= $this->copyFromStorage($sourceStorage, $sourceInternalPath . '/' . $file, $targetInternalPath . '/' . $file);
626
+						$result &= $this->copyFromStorage($sourceStorage, $sourceInternalPath.'/'.$file, $targetInternalPath.'/'.$file);
627 627
 					}
628 628
 				}
629 629
 			}
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
 				$this->getCache()->remove($targetInternalPath);
652 652
 			}
653 653
 		}
654
-		return (bool)$result;
654
+		return (bool) $result;
655 655
 	}
656 656
 
657 657
 	/**
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 	 */
712 712
 	public function getMetaData($path) {
713 713
 		if (Filesystem::isFileBlacklisted($path)) {
714
-			throw new ForbiddenException('Invalid path: ' . $path, false);
714
+			throw new ForbiddenException('Invalid path: '.$path, false);
715 715
 		}
716 716
 
717 717
 		$permissions = $this->getPermissions($path);
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
 			);
763 763
 		}
764 764
 		try {
765
-			$provider->acquireLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type, $this->getId() . '::' . $path);
765
+			$provider->acquireLock('files/'.md5($this->getId().'::'.trim($path, '/')), $type, $this->getId().'::'.$path);
766 766
 		} catch (LockedException $e) {
767 767
 			$e = new LockedException($e->getPath(), $e, $e->getExistingLock(), $path);
768 768
 			if ($logger) {
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
 			);
796 796
 		}
797 797
 		try {
798
-			$provider->releaseLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type);
798
+			$provider->releaseLock('files/'.md5($this->getId().'::'.trim($path, '/')), $type);
799 799
 		} catch (LockedException $e) {
800 800
 			$e = new LockedException($e->getPath(), $e, $e->getExistingLock(), $path);
801 801
 			if ($logger) {
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 			);
829 829
 		}
830 830
 		try {
831
-			$provider->changeLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type);
831
+			$provider->changeLock('files/'.md5($this->getId().'::'.trim($path, '/')), $type);
832 832
 		} catch (LockedException $e) {
833 833
 			$e = new LockedException($e->getPath(), $e, $e->getExistingLock(), $path);
834 834
 			if ($logger) {
@@ -898,7 +898,7 @@  discard block
 block discarded – undo
898 898
 			$basePath = rtrim($directory, '/');
899 899
 			while (($file = readdir($dh)) !== false) {
900 900
 				if (!Filesystem::isIgnoredDir($file)) {
901
-					$childPath = $basePath . '/' . trim($file, '/');
901
+					$childPath = $basePath.'/'.trim($file, '/');
902 902
 					$metadata = $this->getMetaData($childPath);
903 903
 					if ($metadata !== null) {
904 904
 						yield $metadata;
Please login to merge, or discard this patch.