From: Julius Härtl Date: Wed, 28 Jun 2023 05:53:35 +0000 (+0200) Subject: Merge pull request #37969 from nextcloud/poc/noid/systemtags-perf-tag-endpoint X-Git-Tag: v28.0.0beta1~816 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=eddb64f8c34b657fae915a4dd2c997123774a422;p=nextcloud-server.git Merge pull request #37969 from nextcloud/poc/noid/systemtags-perf-tag-endpoint --- eddb64f8c34b657fae915a4dd2c997123774a422 diff --cc lib/private/Files/Cache/QuerySearchHelper.php index 75e203d5fd9,964526203b6..15c089a0f11 --- a/lib/private/Files/Cache/QuerySearchHelper.php +++ b/lib/private/Files/Cache/QuerySearchHelper.php @@@ -194,10 -208,18 +207,18 @@@ class QuerySearchHelper return $results; } + protected function requireUser(ISearchQuery $searchQuery): IUser { + $user = $searchQuery->getUser(); + if ($user === null) { + throw new \InvalidArgumentException("This search operation requires the user to be set in the query"); + } + return $user; + } + /** - * @return array{array, array} + * @return list{0?: array, 1?: array} */ - public function getCachesAndMountPointsForSearch(Root $root, string $path, bool $limitToHome = false): array { + public function getCachesAndMountPointsForSearch(IRootFolder $root, string $path, bool $limitToHome = false): array { $rootLength = strlen($path); $mount = $root->getMount($path); $storage = $mount->getStorage();