@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | if (!$this->isValidPath($path)) { |
71 | 71 | throw new NotPermittedException('Invalid path'); |
72 | 72 | } |
73 | - return $this->path . $path; |
|
73 | + return $this->path.$path; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @return bool |
89 | 89 | */ |
90 | 90 | public function isSubNode($node) { |
91 | - return strpos($node->getPath(), $this->path . '/') === 0; |
|
91 | + return strpos($node->getPath(), $this->path.'/') === 0; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | public function getDirectoryListing() { |
101 | 101 | $folderContent = $this->view->getDirectoryContent($this->path, '', $this->getFileInfo()); |
102 | 102 | |
103 | - return array_map(function (FileInfo $info) { |
|
103 | + return array_map(function(FileInfo $info) { |
|
104 | 104 | if ($info->getMimetype() === FileInfo::MIMETYPE_FOLDER) { |
105 | 105 | return new Folder($this->root, $this->view, $info->getPath(), $info, $this); |
106 | 106 | } else { |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | public function search($query) { |
224 | 224 | if (is_string($query)) { |
225 | - $query = $this->queryFromOperator(new SearchComparison(ISearchComparison::COMPARE_LIKE, 'name', '%' . $query . '%')); |
|
225 | + $query = $this->queryFromOperator(new SearchComparison(ISearchComparison::COMPARE_LIKE, 'name', '%'.$query.'%')); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | // search is handled by a single query covering all caches that this folder contains |
@@ -266,22 +266,22 @@ discard block |
||
266 | 266 | $resultsPerCache = $searchHelper->searchInCaches($query, $caches); |
267 | 267 | |
268 | 268 | // loop through all results per-cache, constructing the FileInfo object from the CacheEntry and merge them all |
269 | - $files = array_merge(...array_map(function (array $results, $relativeMountPoint) use ($mountByMountPoint) { |
|
269 | + $files = array_merge(...array_map(function(array $results, $relativeMountPoint) use ($mountByMountPoint) { |
|
270 | 270 | $mount = $mountByMountPoint[$relativeMountPoint]; |
271 | - return array_map(function (ICacheEntry $result) use ($relativeMountPoint, $mount) { |
|
271 | + return array_map(function(ICacheEntry $result) use ($relativeMountPoint, $mount) { |
|
272 | 272 | return $this->cacheEntryToFileInfo($mount, $relativeMountPoint, $result); |
273 | 273 | }, $results); |
274 | 274 | }, array_values($resultsPerCache), array_keys($resultsPerCache))); |
275 | 275 | |
276 | 276 | // don't include this folder in the results |
277 | - $files = array_filter($files, function (FileInfo $file) { |
|
277 | + $files = array_filter($files, function(FileInfo $file) { |
|
278 | 278 | return $file->getPath() !== $this->getPath(); |
279 | 279 | }); |
280 | 280 | |
281 | 281 | // since results were returned per-cache, they are no longer fully sorted |
282 | 282 | $order = $query->getOrder(); |
283 | 283 | if ($order) { |
284 | - usort($files, function (FileInfo $a, FileInfo $b) use ($order) { |
|
284 | + usort($files, function(FileInfo $a, FileInfo $b) use ($order) { |
|
285 | 285 | foreach ($order as $orderField) { |
286 | 286 | $cmp = $orderField->sortFileInfo($a, $b); |
287 | 287 | if ($cmp !== 0) { |
@@ -292,16 +292,16 @@ discard block |
||
292 | 292 | }); |
293 | 293 | } |
294 | 294 | |
295 | - return array_map(function (FileInfo $file) { |
|
295 | + return array_map(function(FileInfo $file) { |
|
296 | 296 | return $this->createNode($file->getPath(), $file); |
297 | 297 | }, $files); |
298 | 298 | } |
299 | 299 | |
300 | 300 | private function cacheEntryToFileInfo(IMountPoint $mount, string $appendRoot, ICacheEntry $cacheEntry): FileInfo { |
301 | 301 | $cacheEntry['internalPath'] = $cacheEntry['path']; |
302 | - $cacheEntry['path'] = rtrim($appendRoot . $cacheEntry->getPath(), '/'); |
|
303 | - $subPath = $cacheEntry['path'] !== '' ? '/' . $cacheEntry['path'] : ''; |
|
304 | - return new \OC\Files\FileInfo($this->path . $subPath, $mount->getStorage(), $cacheEntry['internalPath'], $cacheEntry, $mount); |
|
302 | + $cacheEntry['path'] = rtrim($appendRoot.$cacheEntry->getPath(), '/'); |
|
303 | + $subPath = $cacheEntry['path'] !== '' ? '/'.$cacheEntry['path'] : ''; |
|
304 | + return new \OC\Files\FileInfo($this->path.$subPath, $mount->getStorage(), $cacheEntry['internalPath'], $cacheEntry, $mount); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /** |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | */ |
313 | 313 | public function searchByMime($mimetype) { |
314 | 314 | if (strpos($mimetype, '/') === false) { |
315 | - $query = $this->queryFromOperator(new SearchComparison(ISearchComparison::COMPARE_LIKE, 'mimetype', $mimetype . '/%')); |
|
315 | + $query = $this->queryFromOperator(new SearchComparison(ISearchComparison::COMPARE_LIKE, 'mimetype', $mimetype.'/%')); |
|
316 | 316 | } else { |
317 | 317 | $query = $this->queryFromOperator(new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'mimetype', $mimetype)); |
318 | 318 | } |
@@ -336,12 +336,12 @@ discard block |
||
336 | 336 | * @return \OC\Files\Node\Node[] |
337 | 337 | */ |
338 | 338 | public function getById($id) { |
339 | - return $this->root->getByIdInPath((int)$id, $this->getPath()); |
|
339 | + return $this->root->getByIdInPath((int) $id, $this->getPath()); |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | protected function getAppDataDirectoryName(): string { |
343 | 343 | $instanceId = \OC::$server->getConfig()->getSystemValueString('instanceid'); |
344 | - return 'appdata_' . $instanceId; |
|
344 | + return 'appdata_'.$instanceId; |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | /** |
@@ -363,8 +363,8 @@ discard block |
||
363 | 363 | return []; |
364 | 364 | } |
365 | 365 | |
366 | - $absolutePath = '/' . ltrim($cacheEntry->getPath(), '/'); |
|
367 | - $currentPath = rtrim($this->path, '/') . '/'; |
|
366 | + $absolutePath = '/'.ltrim($cacheEntry->getPath(), '/'); |
|
367 | + $currentPath = rtrim($this->path, '/').'/'; |
|
368 | 368 | |
369 | 369 | if (strpos($absolutePath, $currentPath) !== 0) { |
370 | 370 | return []; |