@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | if (!$this->isValidPath($path)) { |
57 | 57 | throw new NotPermittedException('Invalid path'); |
58 | 58 | } |
59 | - return $this->path . $this->normalizePath($path); |
|
59 | + return $this->path.$this->normalizePath($path); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | if ($path === $this->path) { |
71 | 71 | return '/'; |
72 | - } else if (strpos($path, $this->path . '/') !== 0) { |
|
72 | + } else if (strpos($path, $this->path.'/') !== 0) { |
|
73 | 73 | return null; |
74 | 74 | } else { |
75 | 75 | $path = substr($path, strlen($this->path)); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @return bool |
85 | 85 | */ |
86 | 86 | public function isSubNode($node) { |
87 | - return strpos($node->getPath(), $this->path . '/') === 0; |
|
87 | + return strpos($node->getPath(), $this->path.'/') === 0; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | public function getDirectoryListing() { |
97 | 97 | $folderContent = $this->view->getDirectoryContent($this->path); |
98 | 98 | |
99 | - return array_map(function (FileInfo $info) { |
|
99 | + return array_map(function(FileInfo $info) { |
|
100 | 100 | if ($info->getMimetype() === 'httpd/unix-directory') { |
101 | 101 | return new Folder($this->root, $this->view, $info->getPath(), $info); |
102 | 102 | } else { |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | */ |
198 | 198 | public function search($query) { |
199 | 199 | if (is_string($query)) { |
200 | - return $this->searchCommon('search', array('%' . $query . '%')); |
|
200 | + return $this->searchCommon('search', array('%'.$query.'%')); |
|
201 | 201 | } else { |
202 | 202 | return $this->searchCommon('searchQuery', array($query)); |
203 | 203 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | $internalPath = $mount->getInternalPath($this->path); |
238 | 238 | $internalPath = rtrim($internalPath, '/'); |
239 | 239 | if ($internalPath !== '') { |
240 | - $internalPath = $internalPath . '/'; |
|
240 | + $internalPath = $internalPath.'/'; |
|
241 | 241 | } |
242 | 242 | $internalRootLength = strlen($internalPath); |
243 | 243 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $result['internalPath'] = $result['path']; |
250 | 250 | $result['path'] = substr($result['path'], $internalRootLength); |
251 | 251 | $result['storage'] = $storage; |
252 | - $files[] = new \OC\Files\FileInfo($this->path . '/' . $result['path'], $storage, $result['internalPath'], $result, $mount); |
|
252 | + $files[] = new \OC\Files\FileInfo($this->path.'/'.$result['path'], $storage, $result['internalPath'], $result, $mount); |
|
253 | 253 | } |
254 | 254 | } |
255 | 255 | |
@@ -263,14 +263,14 @@ discard block |
||
263 | 263 | $results = call_user_func_array(array($cache, $method), $args); |
264 | 264 | foreach ($results as $result) { |
265 | 265 | $result['internalPath'] = $result['path']; |
266 | - $result['path'] = $relativeMountPoint . $result['path']; |
|
266 | + $result['path'] = $relativeMountPoint.$result['path']; |
|
267 | 267 | $result['storage'] = $storage; |
268 | - $files[] = new \OC\Files\FileInfo($this->path . '/' . $result['path'], $storage, $result['internalPath'], $result, $mount); |
|
268 | + $files[] = new \OC\Files\FileInfo($this->path.'/'.$result['path'], $storage, $result['internalPath'], $result, $mount); |
|
269 | 269 | } |
270 | 270 | } |
271 | 271 | } |
272 | 272 | |
273 | - return array_map(function (FileInfo $file) { |
|
273 | + return array_map(function(FileInfo $file) { |
|
274 | 274 | return $this->createNode($file->getPath(), $file); |
275 | 275 | }, $files); |
276 | 276 | } |
@@ -286,16 +286,16 @@ discard block |
||
286 | 286 | } else { |
287 | 287 | $user = null; |
288 | 288 | } |
289 | - $mountsContainingFile = $mountCache->getMountsForFileId((int)$id, $user); |
|
289 | + $mountsContainingFile = $mountCache->getMountsForFileId((int) $id, $user); |
|
290 | 290 | $mounts = $this->root->getMountsIn($this->path); |
291 | 291 | $mounts[] = $this->root->getMount($this->path); |
292 | 292 | /** @var IMountPoint[] $folderMounts */ |
293 | - $folderMounts = array_combine(array_map(function (IMountPoint $mountPoint) { |
|
293 | + $folderMounts = array_combine(array_map(function(IMountPoint $mountPoint) { |
|
294 | 294 | return $mountPoint->getMountPoint(); |
295 | 295 | }, $mounts), $mounts); |
296 | 296 | |
297 | 297 | /** @var ICachedMountInfo[] $mountsContainingFile */ |
298 | - $mountsContainingFile = array_values(array_filter($mountsContainingFile, function (ICachedMountInfo $cachedMountInfo) use ($folderMounts) { |
|
298 | + $mountsContainingFile = array_values(array_filter($mountsContainingFile, function(ICachedMountInfo $cachedMountInfo) use ($folderMounts) { |
|
299 | 299 | return isset($folderMounts[$cachedMountInfo->getMountPoint()]); |
300 | 300 | })); |
301 | 301 | |
@@ -303,18 +303,18 @@ discard block |
||
303 | 303 | return []; |
304 | 304 | } |
305 | 305 | |
306 | - $nodes = array_map(function (ICachedMountInfo $cachedMountInfo) use ($folderMounts, $id) { |
|
306 | + $nodes = array_map(function(ICachedMountInfo $cachedMountInfo) use ($folderMounts, $id) { |
|
307 | 307 | $mount = $folderMounts[$cachedMountInfo->getMountPoint()]; |
308 | - $cacheEntry = $mount->getStorage()->getCache()->get((int)$id); |
|
308 | + $cacheEntry = $mount->getStorage()->getCache()->get((int) $id); |
|
309 | 309 | if (!$cacheEntry) { |
310 | 310 | return null; |
311 | 311 | } |
312 | 312 | |
313 | 313 | // cache jails will hide the "true" internal path |
314 | - $internalPath = ltrim($cachedMountInfo->getRootInternalPath() . '/' . $cacheEntry->getPath(), '/'); |
|
314 | + $internalPath = ltrim($cachedMountInfo->getRootInternalPath().'/'.$cacheEntry->getPath(), '/'); |
|
315 | 315 | $pathRelativeToMount = substr($internalPath, strlen($cachedMountInfo->getRootInternalPath())); |
316 | 316 | $pathRelativeToMount = ltrim($pathRelativeToMount, '/'); |
317 | - $absolutePath = rtrim($cachedMountInfo->getMountPoint() . $pathRelativeToMount, '/'); |
|
317 | + $absolutePath = rtrim($cachedMountInfo->getMountPoint().$pathRelativeToMount, '/'); |
|
318 | 318 | return $this->root->createNode($absolutePath, new \OC\Files\FileInfo( |
319 | 319 | $absolutePath, $mount->getStorage(), $cacheEntry->getPath(), $cacheEntry, $mount, |
320 | 320 | \OC::$server->getUserManager()->get($mount->getStorage()->getOwner($pathRelativeToMount)) |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | $nodes = array_filter($nodes); |
325 | 325 | |
326 | - return array_filter($nodes, function (Node $node) { |
|
326 | + return array_filter($nodes, function(Node $node) { |
|
327 | 327 | return $this->getRelativePath($node->getPath()); |
328 | 328 | }); |
329 | 329 | } |
@@ -367,10 +367,10 @@ discard block |
||
367 | 367 | $mounts = $this->root->getMountsIn($this->path); |
368 | 368 | $mounts[] = $this->getMountPoint(); |
369 | 369 | |
370 | - $mounts = array_filter($mounts, function (IMountPoint $mount) { |
|
370 | + $mounts = array_filter($mounts, function(IMountPoint $mount) { |
|
371 | 371 | return $mount->getStorage(); |
372 | 372 | }); |
373 | - $storageIds = array_map(function (IMountPoint $mount) { |
|
373 | + $storageIds = array_map(function(IMountPoint $mount) { |
|
374 | 374 | return $mount->getStorage()->getCache()->getNumericStorageId(); |
375 | 375 | }, $mounts); |
376 | 376 | /** @var IMountPoint[] $mountMap */ |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | } |
421 | 421 | |
422 | 422 | private function recentParse($result, $mountMap, $mimetypeLoader) { |
423 | - $files = array_filter(array_map(function (array $entry) use ($mountMap, $mimetypeLoader) { |
|
423 | + $files = array_filter(array_map(function(array $entry) use ($mountMap, $mimetypeLoader) { |
|
424 | 424 | $mount = $mountMap[$entry['storage']]; |
425 | 425 | $entry['internalPath'] = $entry['path']; |
426 | 426 | $entry['mimetype'] = $mimetypeLoader->getMimetypeById($entry['mimetype']); |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | return $this->root->createNode($fileInfo->getPath(), $fileInfo); |
434 | 434 | }, $result)); |
435 | 435 | |
436 | - return array_values(array_filter($files, function (Node $node) { |
|
436 | + return array_values(array_filter($files, function(Node $node) { |
|
437 | 437 | $relative = $this->getRelativePath($node->getPath()); |
438 | 438 | return $relative !== null && $relative !== '/'; |
439 | 439 | })); |
@@ -450,13 +450,13 @@ discard block |
||
450 | 450 | $rootLength = strlen($jailRoot) + 1; |
451 | 451 | if ($path === $jailRoot) { |
452 | 452 | return $mount->getMountPoint(); |
453 | - } else if (substr($path, 0, $rootLength) === $jailRoot . '/') { |
|
454 | - return $mount->getMountPoint() . substr($path, $rootLength); |
|
453 | + } else if (substr($path, 0, $rootLength) === $jailRoot.'/') { |
|
454 | + return $mount->getMountPoint().substr($path, $rootLength); |
|
455 | 455 | } else { |
456 | 456 | return null; |
457 | 457 | } |
458 | 458 | } else { |
459 | - return $mount->getMountPoint() . $path; |
|
459 | + return $mount->getMountPoint().$path; |
|
460 | 460 | } |
461 | 461 | } |
462 | 462 | } |