diff options
Diffstat (limited to 'lib/private/FullTextSearch/FullTextSearchManager.php')
-rw-r--r-- | lib/private/FullTextSearch/FullTextSearchManager.php | 104 |
1 files changed, 31 insertions, 73 deletions
diff --git a/lib/private/FullTextSearch/FullTextSearchManager.php b/lib/private/FullTextSearch/FullTextSearchManager.php index 8d850513949..989da8d6bae 100644 --- a/lib/private/FullTextSearch/FullTextSearchManager.php +++ b/lib/private/FullTextSearch/FullTextSearchManager.php @@ -3,25 +3,8 @@ declare(strict_types=1); /** - * @copyright 2018, Maxence Lange <maxence@artificial-owl.com> - * - * @author Maxence Lange <maxence@artificial-owl.com> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OC\FullTextSearch; @@ -39,52 +22,40 @@ use OCP\FullTextSearch\Service\ISearchService; * @package OC\FullTextSearch */ class FullTextSearchManager implements IFullTextSearchManager { - /** @var IProviderService */ - private $providerService; + private ?IProviderService $providerService = null; - /** @var IIndexService */ - private $indexService; - - /** @var ISearchService */ - private $searchService; + private ?IIndexService $indexService = null; + private ?ISearchService $searchService = null; /** * @since 15.0.0 - * - * @param IProviderService $providerService */ - public function registerProviderService(IProviderService $providerService) { + public function registerProviderService(IProviderService $providerService): void { $this->providerService = $providerService; } /** * @since 15.0.0 - * - * @param IIndexService $indexService */ - public function registerIndexService(IIndexService $indexService) { + public function registerIndexService(IIndexService $indexService): void { $this->indexService = $indexService; } /** * @since 15.0.0 - * - * @param ISearchService $searchService */ - public function registerSearchService(ISearchService $searchService) { + public function registerSearchService(ISearchService $searchService): void { $this->searchService = $searchService; } /** * @since 16.0.0 - * - * @return bool */ public function isAvailable(): bool { - if ($this->indexService === null || - $this->providerService === null || - $this->searchService === null) { + if ($this->indexService === null + || $this->providerService === null + || $this->searchService === null) { return false; } @@ -93,7 +64,6 @@ class FullTextSearchManager implements IFullTextSearchManager { /** - * @return IProviderService * @throws FullTextSearchAppNotAvailableException */ private function getProviderService(): IProviderService { @@ -106,7 +76,6 @@ class FullTextSearchManager implements IFullTextSearchManager { /** - * @return IIndexService * @throws FullTextSearchAppNotAvailableException */ private function getIndexService(): IIndexService { @@ -119,7 +88,6 @@ class FullTextSearchManager implements IFullTextSearchManager { /** - * @return ISearchService * @throws FullTextSearchAppNotAvailableException */ private function getSearchService(): ISearchService { @@ -134,15 +102,12 @@ class FullTextSearchManager implements IFullTextSearchManager { /** * @throws FullTextSearchAppNotAvailableException */ - public function addJavascriptAPI() { + public function addJavascriptAPI(): void { $this->getProviderService()->addJavascriptAPI(); } /** - * @param string $providerId - * - * @return bool * @throws FullTextSearchAppNotAvailableException */ public function isProviderIndexed(string $providerId): bool { @@ -151,9 +116,6 @@ class FullTextSearchManager implements IFullTextSearchManager { /** - * @param string $providerId - * @param string $documentId - * @return IIndex * @throws FullTextSearchAppNotAvailableException */ public function getIndex(string $providerId, string $documentId): IIndex { @@ -161,46 +123,45 @@ class FullTextSearchManager implements IFullTextSearchManager { } /** - * @param string $providerId - * @param string $documentId - * @param string $userId - * @param int $status - * * @see IIndex for available value for $status. * - * @return IIndex * @throws FullTextSearchAppNotAvailableException */ - public function createIndex(string $providerId, string $documentId, string $userId, int $status = 0): IIndex { + public function createIndex( + string $providerId, + string $documentId, + string $userId, + int $status = 0, + ): IIndex { return $this->getIndexService()->createIndex($providerId, $documentId, $userId, $status); } /** - * @param string $providerId - * @param string $documentId - * @param int $status - * @param bool $reset - * * @see IIndex for available value for $status. * * @throws FullTextSearchAppNotAvailableException */ - public function updateIndexStatus(string $providerId, string $documentId, int $status, bool $reset = false) { + public function updateIndexStatus( + string $providerId, + string $documentId, + int $status, + bool $reset = false, + ): void { $this->getIndexService()->updateIndexStatus($providerId, $documentId, $status, $reset); } /** - * @param string $providerId - * @param array $documentIds - * @param int $status - * @param bool $reset - * * @see IIndex for available value for $status. * * @throws FullTextSearchAppNotAvailableException */ - public function updateIndexesStatus(string $providerId, array $documentIds, int $status, bool $reset = false) { + public function updateIndexesStatus( + string $providerId, + array $documentIds, + int $status, + bool $reset = false, + ): void { $this->getIndexService()->updateIndexesStatus($providerId, $documentIds, $status, $reset); } @@ -210,15 +171,12 @@ class FullTextSearchManager implements IFullTextSearchManager { * * @throws FullTextSearchAppNotAvailableException */ - public function updateIndexes(array $indexes) { + public function updateIndexes(array $indexes): void { $this->getIndexService()->updateIndexes($indexes); } /** - * @param array $request - * @param string $userId - * * @return ISearchResult[] * @throws FullTextSearchAppNotAvailableException */ |