@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | $options = new Options(); |
| 122 | 122 | if (isset($params['timeout'])) { |
| 123 | - $timeout = (int)$params['timeout']; |
|
| 123 | + $timeout = (int) $params['timeout']; |
|
| 124 | 124 | if ($timeout > 0) { |
| 125 | 125 | $options->setTimeout($timeout); |
| 126 | 126 | } |
@@ -130,8 +130,8 @@ discard block |
||
| 130 | 130 | $this->share = $this->server->getShare(trim($params['share'], '/')); |
| 131 | 131 | |
| 132 | 132 | $this->root = $params['root'] ?? '/'; |
| 133 | - $this->root = '/' . ltrim($this->root, '/'); |
|
| 134 | - $this->root = rtrim($this->root, '/') . '/'; |
|
| 133 | + $this->root = '/'.ltrim($this->root, '/'); |
|
| 134 | + $this->root = rtrim($this->root, '/').'/'; |
|
| 135 | 135 | |
| 136 | 136 | $this->showHidden = isset($params['show_hidden']) && $params['show_hidden']; |
| 137 | 137 | $this->checkAcl = isset($params['check_acl']) && $params['check_acl']; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | // FIXME: double slash to keep compatible with the old storage ids, |
| 158 | 158 | // failure to do so will lead to creation of a new storage id and |
| 159 | 159 | // loss of shares from the storage |
| 160 | - return 'smb::' . $this->server->getAuth()->getUsername() . '@' . $this->server->getHost() . '//' . $this->share->getName() . '/' . $this->root; |
|
| 160 | + return 'smb::'.$this->server->getAuth()->getUsername().'@'.$this->server->getHost().'//'.$this->share->getName().'/'.$this->root; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * @return string |
| 166 | 166 | */ |
| 167 | 167 | protected function buildPath($path) { |
| 168 | - return Filesystem::normalizePath($this->root . '/' . $path, true, false, true); |
|
| 168 | + return Filesystem::normalizePath($this->root.'/'.$path, true, false, true); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | protected function relativePath($fullPath) { |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | return; |
| 252 | 252 | } |
| 253 | 253 | foreach ($files as $file) { |
| 254 | - $this->statCache[$path . '/' . $file->getName()] = $file; |
|
| 254 | + $this->statCache[$path.'/'.$file->getName()] = $file; |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | foreach ($files as $file) { |
@@ -265,21 +265,21 @@ discard block |
||
| 265 | 265 | // this doesn't take inheritance fully into account but if read permissions is denied for a parent we wouldn't be in this folder |
| 266 | 266 | // additionally, it's better to have false negatives here then false positives |
| 267 | 267 | if ($acl->denies(ACL::MASK_READ) || $acl->denies(ACL::MASK_EXECUTE)) { |
| 268 | - $this->logger->debug('Hiding non readable entry ' . $file->getName()); |
|
| 268 | + $this->logger->debug('Hiding non readable entry '.$file->getName()); |
|
| 269 | 269 | continue; |
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | if ($hide) { |
| 274 | - $this->logger->debug('hiding hidden file ' . $file->getName()); |
|
| 274 | + $this->logger->debug('hiding hidden file '.$file->getName()); |
|
| 275 | 275 | } |
| 276 | 276 | if (!$hide) { |
| 277 | 277 | yield $file; |
| 278 | 278 | } |
| 279 | 279 | } catch (ForbiddenException $e) { |
| 280 | - $this->logger->logException($e, ['level' => ILogger::DEBUG, 'message' => 'Hiding forbidden entry ' . $file->getName()]); |
|
| 280 | + $this->logger->logException($e, ['level' => ILogger::DEBUG, 'message' => 'Hiding forbidden entry '.$file->getName()]); |
|
| 281 | 281 | } catch (NotFoundException $e) { |
| 282 | - $this->logger->logException($e, ['level' => ILogger::DEBUG, 'message' => 'Hiding not found entry ' . $file->getName()]); |
|
| 282 | + $this->logger->logException($e, ['level' => ILogger::DEBUG, 'message' => 'Hiding not found entry '.$file->getName()]); |
|
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | 285 | } catch (ConnectException $e) { |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | case 'w': |
| 471 | 471 | case 'wb': |
| 472 | 472 | $source = $this->share->write($fullPath); |
| 473 | - return CallBackWrapper::wrap($source, null, null, function () use ($fullPath) { |
|
| 473 | + return CallBackWrapper::wrap($source, null, null, function() use ($fullPath) { |
|
| 474 | 474 | unset($this->statCache[$fullPath]); |
| 475 | 475 | }); |
| 476 | 476 | case 'a': |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | } |
| 503 | 503 | $source = fopen($tmpFile, $mode); |
| 504 | 504 | $share = $this->share; |
| 505 | - return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share) { |
|
| 505 | + return CallbackWrapper::wrap($source, null, null, function() use ($tmpFile, $fullPath, $share) { |
|
| 506 | 506 | unset($this->statCache[$fullPath]); |
| 507 | 507 | $share->put($tmpFile, $fullPath); |
| 508 | 508 | unlink($tmpFile); |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | $content = $this->share->dir($this->buildPath($path)); |
| 532 | 532 | foreach ($content as $file) { |
| 533 | 533 | if ($file->isDirectory()) { |
| 534 | - $this->rmdir($path . '/' . $file->getName()); |
|
| 534 | + $this->rmdir($path.'/'.$file->getName()); |
|
| 535 | 535 | } else { |
| 536 | 536 | $this->share->del($file->getPath()); |
| 537 | 537 | } |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | } catch (NotPermittedException $e) { |
| 621 | 621 | return false; |
| 622 | 622 | } |
| 623 | - $names = array_map(function ($info) { |
|
| 623 | + $names = array_map(function($info) { |
|
| 624 | 624 | /** @var IFileInfo $info */ |
| 625 | 625 | return $info->getName(); |
| 626 | 626 | }, iterator_to_array($files)); |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | */ |
| 711 | 711 | public static function checkDependencies() { |
| 712 | 712 | return ( |
| 713 | - (bool)\OC_Helper::findBinaryPath('smbclient') |
|
| 713 | + (bool) \OC_Helper::findBinaryPath('smbclient') |
|
| 714 | 714 | || NativeServer::available(new System()) |
| 715 | 715 | ) ? true : ['smbclient']; |
| 716 | 716 | } |
@@ -730,7 +730,7 @@ discard block |
||
| 730 | 730 | } |
| 731 | 731 | |
| 732 | 732 | public function listen($path, callable $callback) { |
| 733 | - $this->notify($path)->listen(function (IChange $change) use ($callback) { |
|
| 733 | + $this->notify($path)->listen(function(IChange $change) use ($callback) { |
|
| 734 | 734 | if ($change instanceof IRenameChange) { |
| 735 | 735 | return $callback($change->getType(), $change->getPath(), $change->getTargetPath()); |
| 736 | 736 | } else { |
@@ -740,7 +740,7 @@ discard block |
||
| 740 | 740 | } |
| 741 | 741 | |
| 742 | 742 | public function notify($path) { |
| 743 | - $path = '/' . ltrim($path, '/'); |
|
| 743 | + $path = '/'.ltrim($path, '/'); |
|
| 744 | 744 | $shareNotifyHandler = $this->share->notify($this->buildPath($path)); |
| 745 | 745 | return new SMBNotifyHandler($shareNotifyHandler, $this->root); |
| 746 | 746 | } |