From a4947c80966dcb253d2d68c803f3bdc6cc40ff1f Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 14 Nov 2024 09:22:25 -0100 Subject: [PATCH] cleaning code Signed-off-by: Maxence Lange --- lib/Listeners/ListenersCore.php | 1 - lib/Provider/FilesProvider.php | 12 +++--------- lib/Service/ExternalFilesService.php | 7 +------ lib/Service/FilesService.php | 4 +++- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/lib/Listeners/ListenersCore.php b/lib/Listeners/ListenersCore.php index fb57e7f..aea2ff2 100644 --- a/lib/Listeners/ListenersCore.php +++ b/lib/Listeners/ListenersCore.php @@ -33,7 +33,6 @@ public function __construct( ) { } - /** * @return bool */ diff --git a/lib/Provider/FilesProvider.php b/lib/Provider/FilesProvider.php index 07ec45e..22ea909 100644 --- a/lib/Provider/FilesProvider.php +++ b/lib/Provider/FilesProvider.php @@ -41,7 +41,7 @@ */ class FilesProvider implements IFullTextSearchProvider { public const FILES_PROVIDER_ID = 'files'; - private IRunner $runner; + private ?IRunner $runner = null; private IIndexOptions $indexOptions; public function __construct( @@ -54,7 +54,6 @@ public function __construct( ) { } - /** * return unique id of the provider */ @@ -62,7 +61,6 @@ public function getId(): string { return self::FILES_PROVIDER_ID; } - /** * return name of the provider */ @@ -70,7 +68,6 @@ public function getName(): string { return 'Files'; } - /** * @return array */ @@ -83,7 +80,6 @@ public function getConfiguration(): array { return $config; } - /** * @param IRunner $runner */ @@ -92,7 +88,6 @@ public function setRunner(IRunner $runner) { $this->filesService->setRunner($runner); } - /** * @param IIndexOptions $options */ @@ -100,7 +95,6 @@ public function setIndexOptions(IIndexOptions $options) { $this->indexOptions = $options; } - /** * @return ISearchTemplate */ @@ -291,8 +285,8 @@ public function unloadProvider() { * * @param ISearchRequest $request */ - public function improveSearchRequest(ISearchRequest $request) { - $this->searchService->improveSearchRequest($request); + public function improveSearchRequest(ISearchRequest $searchRequest) { + $this->searchService->improveSearchRequest($searchRequest); } diff --git a/lib/Service/ExternalFilesService.php b/lib/Service/ExternalFilesService.php index f4c9500..f9b132f 100644 --- a/lib/Service/ExternalFilesService.php +++ b/lib/Service/ExternalFilesService.php @@ -48,7 +48,6 @@ public function __construct( ) { } - /** * @param string $userId */ @@ -135,8 +134,6 @@ public function updateDocumentAccess(FilesDocument &$document, Node $file) { $document->getIndex() ->addOptionInt('external_mount_id', $mount->getId()); $document->setAccess($access); - - $document->setAccess($access); } @@ -263,8 +260,6 @@ private function getRandomUserFromMountPoint(MountPoint $mount): string { } } - throw new ExternalMountWithNoViewerException( - 'cannot get a valid user for external mount' - ); + throw new ExternalMountWithNoViewerException('cannot get a valid user for external mount'); } } diff --git a/lib/Service/FilesService.php b/lib/Service/FilesService.php index d3efa5f..c3ff3a5 100644 --- a/lib/Service/FilesService.php +++ b/lib/Service/FilesService.php @@ -736,7 +736,7 @@ private function updateShareNames(FilesDocument $document, Node $file): array { $shareNames[$this->secureUsername($username)] = (!is_string($path)) ? $path = '' : $path; } catch (Throwable $e) { - $this->logger->warning('Issue while getting information on documentId:' . $document->getId(), ['exception' => $e]); + $this->logger->debug('Issue while getting information on documentId:' . $document->getId(), ['exception' => $e]); } } @@ -1143,6 +1143,8 @@ private function manageContentErrorException(IIndexDocument $document, Throwable $t->getMessage(), IIndex::ERROR_SEV_3 ); + + $this->logger->debug('content error', ['exception' => $t]); }