@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $this->root = isset($params['root']) ? $params['root'] : '/'; |
| 90 | 90 | if (!$this->root || $this->root[0] !== '/') { |
| 91 | - $this->root = '/' . $this->root; |
|
| 91 | + $this->root = '/'.$this->root; |
|
| 92 | 92 | } |
| 93 | 93 | if (substr($this->root, -1, 1) !== '/') { |
| 94 | 94 | $this->root .= '/'; |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | // FIXME: double slash to keep compatible with the old storage ids, |
| 108 | 108 | // failure to do so will lead to creation of a new storage id and |
| 109 | 109 | // loss of shares from the storage |
| 110 | - return 'smb::' . $this->server->getUser() . '@' . $this->server->getHost() . '//' . $this->share->getName() . '/' . $this->root; |
|
| 110 | + return 'smb::'.$this->server->getUser().'@'.$this->server->getHost().'//'.$this->share->getName().'/'.$this->root; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * @return string |
| 116 | 116 | */ |
| 117 | 117 | protected function buildPath($path) { |
| 118 | - return Filesystem::normalizePath($this->root . '/' . $path, true, false, true); |
|
| 118 | + return Filesystem::normalizePath($this->root.'/'.$path, true, false, true); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | protected function relativePath($fullPath) { |
@@ -156,19 +156,19 @@ discard block |
||
| 156 | 156 | $path = $this->buildPath($path); |
| 157 | 157 | $files = $this->share->dir($path); |
| 158 | 158 | foreach ($files as $file) { |
| 159 | - $this->statCache[$path . '/' . $file->getName()] = $file; |
|
| 159 | + $this->statCache[$path.'/'.$file->getName()] = $file; |
|
| 160 | 160 | } |
| 161 | - return array_filter($files, function (IFileInfo $file) { |
|
| 161 | + return array_filter($files, function(IFileInfo $file) { |
|
| 162 | 162 | try { |
| 163 | 163 | if ($file->isHidden()) { |
| 164 | - \OC::$server->getLogger()->debug('hiding hidden file ' . $file->getName()); |
|
| 164 | + \OC::$server->getLogger()->debug('hiding hidden file '.$file->getName()); |
|
| 165 | 165 | } |
| 166 | 166 | return !$file->isHidden(); |
| 167 | 167 | } catch (ForbiddenException $e) { |
| 168 | - \OC::$server->getLogger()->logException($e, ['level' => Util::DEBUG, 'message' => 'Hiding forbidden entry ' . $file->getName()]); |
|
| 168 | + \OC::$server->getLogger()->logException($e, ['level' => Util::DEBUG, 'message' => 'Hiding forbidden entry '.$file->getName()]); |
|
| 169 | 169 | return false; |
| 170 | 170 | } catch (NotFoundException $e) { |
| 171 | - \OC::$server->getLogger()->logException($e, ['level' => Util::DEBUG, 'message' => 'Hiding not found entry ' . $file->getName()]); |
|
| 171 | + \OC::$server->getLogger()->logException($e, ['level' => Util::DEBUG, 'message' => 'Hiding not found entry '.$file->getName()]); |
|
| 172 | 172 | return false; |
| 173 | 173 | } |
| 174 | 174 | }); |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | case 'w': |
| 353 | 353 | case 'wb': |
| 354 | 354 | $source = $this->share->write($fullPath); |
| 355 | - return CallBackWrapper::wrap($source, null, null, function () use ($fullPath) { |
|
| 355 | + return CallBackWrapper::wrap($source, null, null, function() use ($fullPath) { |
|
| 356 | 356 | unset($this->statCache[$fullPath]); |
| 357 | 357 | }); |
| 358 | 358 | case 'a': |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | } |
| 385 | 385 | $source = fopen($tmpFile, $mode); |
| 386 | 386 | $share = $this->share; |
| 387 | - return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath, $share) { |
|
| 387 | + return CallbackWrapper::wrap($source, null, null, function() use ($tmpFile, $fullPath, $share) { |
|
| 388 | 388 | unset($this->statCache[$fullPath]); |
| 389 | 389 | $share->put($tmpFile, $fullPath); |
| 390 | 390 | unlink($tmpFile); |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | $content = $this->share->dir($this->buildPath($path)); |
| 412 | 412 | foreach ($content as $file) { |
| 413 | 413 | if ($file->isDirectory()) { |
| 414 | - $this->rmdir($path . '/' . $file->getName()); |
|
| 414 | + $this->rmdir($path.'/'.$file->getName()); |
|
| 415 | 415 | } else { |
| 416 | 416 | $this->share->del($file->getPath()); |
| 417 | 417 | } |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | } catch (ForbiddenException $e) { |
| 451 | 451 | return false; |
| 452 | 452 | } |
| 453 | - $names = array_map(function ($info) { |
|
| 453 | + $names = array_map(function($info) { |
|
| 454 | 454 | /** @var \Icewind\SMB\IFileInfo $info */ |
| 455 | 455 | return $info->getName(); |
| 456 | 456 | }, $files); |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | */ |
| 534 | 534 | public static function checkDependencies() { |
| 535 | 535 | return ( |
| 536 | - (bool)\OC_Helper::findBinaryPath('smbclient') |
|
| 536 | + (bool) \OC_Helper::findBinaryPath('smbclient') |
|
| 537 | 537 | || Server::NativeAvailable() |
| 538 | 538 | ) ? true : ['smbclient']; |
| 539 | 539 | } |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | public function listen($path, callable $callback) { |
| 556 | - $this->notify($path)->listen(function (IChange $change) use ($callback) { |
|
| 556 | + $this->notify($path)->listen(function(IChange $change) use ($callback) { |
|
| 557 | 557 | if ($change instanceof IRenameChange) { |
| 558 | 558 | return $callback($change->getType(), $change->getPath(), $change->getTargetPath()); |
| 559 | 559 | } else { |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | public function notify($path) { |
| 566 | - $path = '/' . ltrim($path, '/'); |
|
| 566 | + $path = '/'.ltrim($path, '/'); |
|
| 567 | 567 | $shareNotifyHandler = $this->share->notify($this->buildPath($path)); |
| 568 | 568 | return new SMBNotifyHandler($shareNotifyHandler, $this->root); |
| 569 | 569 | } |