Passed
Push — master ( ea0f02...544830 )
by Morris
85:26 queued 72:05
created
apps/files_external/lib/Lib/Storage/SMB.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
 		$options = new Options();
121 121
 		if (isset($params['timeout'])) {
122
-			$timeout = (int)$params['timeout'];
122
+			$timeout = (int) $params['timeout'];
123 123
 			if ($timeout > 0) {
124 124
 				$options->setTimeout($timeout);
125 125
 			}
@@ -129,8 +129,8 @@  discard block
 block discarded – undo
129 129
 		$this->share = $this->server->getShare(trim($params['share'], '/'));
130 130
 
131 131
 		$this->root = $params['root'] ?? '/';
132
-		$this->root = '/' . ltrim($this->root, '/');
133
-		$this->root = rtrim($this->root, '/') . '/';
132
+		$this->root = '/'.ltrim($this->root, '/');
133
+		$this->root = rtrim($this->root, '/').'/';
134 134
 
135 135
 		$this->showHidden = isset($params['show_hidden']) && $params['show_hidden'];
136 136
 		$this->checkAcl = isset($params['check_acl']) && $params['check_acl'];
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 		// FIXME: double slash to keep compatible with the old storage ids,
157 157
 		// failure to do so will lead to creation of a new storage id and
158 158
 		// loss of shares from the storage
159
-		return 'smb::' . $this->server->getAuth()->getUsername() . '@' . $this->server->getHost() . '//' . $this->share->getName() . '/' . $this->root;
159
+		return 'smb::'.$this->server->getAuth()->getUsername().'@'.$this->server->getHost().'//'.$this->share->getName().'/'.$this->root;
160 160
 	}
161 161
 
162 162
 	/**
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	 * @return string
165 165
 	 */
166 166
 	protected function buildPath($path) {
167
-		return Filesystem::normalizePath($this->root . '/' . $path, true, false, true);
167
+		return Filesystem::normalizePath($this->root.'/'.$path, true, false, true);
168 168
 	}
169 169
 
170 170
 	protected function relativePath($fullPath) {
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 				throw new NotPermittedException();
243 243
 			}
244 244
 			foreach ($files as $file) {
245
-				$this->statCache[$path . '/' . $file->getName()] = $file;
245
+				$this->statCache[$path.'/'.$file->getName()] = $file;
246 246
 			}
247 247
 
248 248
 			foreach ($files as $file) {
@@ -256,21 +256,21 @@  discard block
 block discarded – undo
256 256
 						// this doesn't take inheritance fully into account but if read permissions is denied for a parent we wouldn't be in this folder
257 257
 						// additionally, it's better to have false negatives here then false positives
258 258
 						if ($acl->denies(ACL::MASK_READ) || $acl->denies(ACL::MASK_EXECUTE)) {
259
-							$this->logger->debug('Hiding non readable entry ' . $file->getName());
259
+							$this->logger->debug('Hiding non readable entry '.$file->getName());
260 260
 							continue;
261 261
 						}
262 262
 					}
263 263
 
264 264
 					if ($hide) {
265
-						$this->logger->debug('hiding hidden file ' . $file->getName());
265
+						$this->logger->debug('hiding hidden file '.$file->getName());
266 266
 					}
267 267
 					if (!$hide) {
268 268
 						yield $file;
269 269
 					}
270 270
 				} catch (ForbiddenException $e) {
271
-					$this->logger->logException($e, ['level' => ILogger::DEBUG, 'message' => 'Hiding forbidden entry ' . $file->getName()]);
271
+					$this->logger->logException($e, ['level' => ILogger::DEBUG, 'message' => 'Hiding forbidden entry '.$file->getName()]);
272 272
 				} catch (NotFoundException $e) {
273
-					$this->logger->logException($e, ['level' => ILogger::DEBUG, 'message' => 'Hiding not found entry ' . $file->getName()]);
273
+					$this->logger->logException($e, ['level' => ILogger::DEBUG, 'message' => 'Hiding not found entry '.$file->getName()]);
274 274
 				}
275 275
 			}
276 276
 		} catch (ConnectException $e) {
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 				case 'w':
462 462
 				case 'wb':
463 463
 					$source = $this->share->write($fullPath);
464
-					return CallBackWrapper::wrap($source, null, null, function () use ($fullPath) {
464
+					return CallBackWrapper::wrap($source, null, null, function() use ($fullPath) {
465 465
 						unset($this->statCache[$fullPath]);
466 466
 					});
467 467
 				case 'a':
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 					}
494 494
 					$source = fopen($tmpFile, $mode);
495 495
 					$share = $this->share;
496
-					return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share) {
496
+					return CallbackWrapper::wrap($source, null, null, function() use ($tmpFile, $fullPath, $share) {
497 497
 						unset($this->statCache[$fullPath]);
498 498
 						$share->put($tmpFile, $fullPath);
499 499
 						unlink($tmpFile);
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 			$content = $this->share->dir($this->buildPath($path));
523 523
 			foreach ($content as $file) {
524 524
 				if ($file->isDirectory()) {
525
-					$this->rmdir($path . '/' . $file->getName());
525
+					$this->rmdir($path.'/'.$file->getName());
526 526
 				} else {
527 527
 					$this->share->del($file->getPath());
528 528
 				}
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
 		} catch (NotPermittedException $e) {
612 612
 			return false;
613 613
 		}
614
-		$names = array_map(function ($info) {
614
+		$names = array_map(function($info) {
615 615
 			/** @var \Icewind\SMB\IFileInfo $info */
616 616
 			return $info->getName();
617 617
 		}, iterator_to_array($files));
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
 	 */
702 702
 	public static function checkDependencies() {
703 703
 		return (
704
-			(bool)\OC_Helper::findBinaryPath('smbclient')
704
+			(bool) \OC_Helper::findBinaryPath('smbclient')
705 705
 			|| NativeServer::available(new System())
706 706
 		) ? true : ['smbclient'];
707 707
 	}
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
 	}
722 722
 
723 723
 	public function listen($path, callable $callback) {
724
-		$this->notify($path)->listen(function (IChange $change) use ($callback) {
724
+		$this->notify($path)->listen(function(IChange $change) use ($callback) {
725 725
 			if ($change instanceof IRenameChange) {
726 726
 				return $callback($change->getType(), $change->getPath(), $change->getTargetPath());
727 727
 			} else {
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 	}
732 732
 
733 733
 	public function notify($path) {
734
-		$path = '/' . ltrim($path, '/');
734
+		$path = '/'.ltrim($path, '/');
735 735
 		$shareNotifyHandler = $this->share->notify($this->buildPath($path));
736 736
 		return new SMBNotifyHandler($shareNotifyHandler, $this->root);
737 737
 	}
Please login to merge, or discard this patch.