@@ -30,9 +30,9 @@ |
||
30 | 30 | namespace OCA\FullTextSearch_ElasticSearch\Service; |
31 | 31 | |
32 | 32 | interface IUserStoragesService { |
33 | - /** |
|
34 | - * Returns an array of strings with all external mountpoints of the current user |
|
35 | - * @return array |
|
36 | - */ |
|
37 | - function getAllStoragesForUser(); |
|
33 | + /** |
|
34 | + * Returns an array of strings with all external mountpoints of the current user |
|
35 | + * @return array |
|
36 | + */ |
|
37 | + function getAllStoragesForUser(); |
|
38 | 38 | } |
39 | 39 | \ No newline at end of file |
@@ -59,13 +59,13 @@ |
||
59 | 59 | $this->registerServices(); |
60 | 60 | } |
61 | 61 | |
62 | - private function registerServices(){ |
|
62 | + private function registerServices() { |
|
63 | 63 | $container = $this->getContainer(); |
64 | 64 | |
65 | 65 | // Make SearchMappingService also work without external storage |
66 | 66 | // if app is inactive or not installed. |
67 | 67 | $container->registerService(SearchMappingService::class, function($c) { |
68 | - try{ |
|
68 | + try { |
|
69 | 69 | $userStoragesService = $c->query(UserGlobalStoragesService::class); |
70 | 70 | return new SearchMappingService( |
71 | 71 | $c->query(ConfigService::class), |
@@ -72,8 +72,7 @@ |
||
72 | 72 | $c->query(MiscService::class), |
73 | 73 | new UserStoragesService($userStoragesService) |
74 | 74 | ); |
75 | - } |
|
76 | - catch (QueryException $e) { |
|
75 | + } catch (QueryException $e) { |
|
77 | 76 | return new SearchMappingService( |
78 | 77 | $c->query(ConfigService::class), |
79 | 78 | $c->query(MiscService::class) |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | |
291 | 291 | foreach ($request->getWildcardFields() as $field) { |
292 | 292 | if (!$this->fieldIsOutLimit($request, $field)) { |
293 | - $queryFields[] = ['wildcard' => [$field => '*' . $content->getWord() . '*']]; |
|
293 | + $queryFields[] = ['wildcard' => [$field => '*'.$content->getWord().'*']]; |
|
294 | 294 | } |
295 | 295 | } |
296 | 296 | |
@@ -338,9 +338,9 @@ discard block |
||
338 | 338 | // external files with "$request->getOption('files_external', '1') === '1'" |
339 | 339 | $externalFileShares = $this->getExternalFileShares(); |
340 | 340 | |
341 | - if (!empty($externalFileShares)){ |
|
341 | + if (!empty($externalFileShares)) { |
|
342 | 342 | $allowedExternalShares = []; |
343 | - foreach($externalFileShares as $fileShare){ |
|
343 | + foreach ($externalFileShares as $fileShare) { |
|
344 | 344 | $allowedExternalShares[] = ['prefix' => ['title' => $fileShare]]; |
345 | 345 | } |
346 | 346 | $externalFilesConditions = []; |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | return [ |
485 | 485 | 'index' => $this->configService->getElasticIndex(), |
486 | 486 | 'type' => 'standard', |
487 | - 'id' => $providerId . ':' . $documentId |
|
487 | + 'id' => $providerId.':'.$documentId |
|
488 | 488 | ]; |
489 | 489 | } |
490 | 490 | |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | private function getPartsFields(ISearchRequest $request) { |
498 | 498 | return array_map( |
499 | 499 | function($value) { |
500 | - return 'parts.' . $value; |
|
500 | + return 'parts.'.$value; |
|
501 | 501 | }, $request->getParts() |
502 | 502 | ); |
503 | 503 | } |
@@ -36,19 +36,19 @@ discard block |
||
36 | 36 | */ |
37 | 37 | class UserStoragesService implements IUserStoragesService { |
38 | 38 | |
39 | - /** @var UserGlobalStoragesService */ |
|
40 | - private $userGlobalStoragesService; |
|
39 | + /** @var UserGlobalStoragesService */ |
|
40 | + private $userGlobalStoragesService; |
|
41 | 41 | |
42 | - public function __construct(UserGlobalStoragesService $userGlobalStoragesService) { |
|
43 | - $this->userGlobalStoragesService = $userGlobalStoragesService; |
|
44 | - } |
|
42 | + public function __construct(UserGlobalStoragesService $userGlobalStoragesService) { |
|
43 | + $this->userGlobalStoragesService = $userGlobalStoragesService; |
|
44 | + } |
|
45 | 45 | |
46 | 46 | /** |
47 | - * Returns an array of strings with all external mountpoints of the current user |
|
48 | - * @return array |
|
49 | - */ |
|
50 | - public function getAllStoragesForUser() { |
|
51 | - $userStorages = $this->userGlobalStoragesService->getAllStoragesForUser(); |
|
47 | + * Returns an array of strings with all external mountpoints of the current user |
|
48 | + * @return array |
|
49 | + */ |
|
50 | + public function getAllStoragesForUser() { |
|
51 | + $userStorages = $this->userGlobalStoragesService->getAllStoragesForUser(); |
|
52 | 52 | $mountPoints = []; |
53 | 53 | foreach($userStorages as $userStorage){ |
54 | 54 | /** @var $userStorage OCA\Files_External\Lib\StorageConfig */ |
@@ -62,5 +62,5 @@ discard block |
||
62 | 62 | $mountPoints[] = $mountPoint; |
63 | 63 | } |
64 | 64 | return $mountPoints; |
65 | - } |
|
65 | + } |
|
66 | 66 | } |
67 | 67 | \ No newline at end of file |
@@ -50,13 +50,13 @@ |
||
50 | 50 | public function getAllStoragesForUser() { |
51 | 51 | $userStorages = $this->userGlobalStoragesService->getAllStoragesForUser(); |
52 | 52 | $mountPoints = []; |
53 | - foreach($userStorages as $userStorage){ |
|
53 | + foreach ($userStorages as $userStorage) { |
|
54 | 54 | /** @var $userStorage OCA\Files_External\Lib\StorageConfig */ |
55 | 55 | $mountPoint = $userStorage->getMountPoint(); |
56 | - if (substr($mountPoint, 0, 1) === '/'){ |
|
56 | + if (substr($mountPoint, 0, 1) === '/') { |
|
57 | 57 | $mountPoint = substr($mountPoint, 1, strlen($mountPoint) - 1); |
58 | 58 | } |
59 | - if (substr($mountPoint, strlen($mountPoint) - 1, 1) !== '/'){ |
|
59 | + if (substr($mountPoint, strlen($mountPoint) - 1, 1) !== '/') { |
|
60 | 60 | $mountPoint .= '/'; |
61 | 61 | } |
62 | 62 | $mountPoints[] = $mountPoint; |