From 2b27a4cda0b6e4cad87e817cb9601f1816320992 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 15 Jun 2023 23:21:56 +0200 Subject: refactor: declare getMount() and getMountsIn() at IRootFolder Signed-off-by: Arthur Schiwon --- lib/private/Files/Cache/QuerySearchHelper.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'lib/private/Files/Cache/QuerySearchHelper.php') diff --git a/lib/private/Files/Cache/QuerySearchHelper.php b/lib/private/Files/Cache/QuerySearchHelper.php index b4376eb2d98..75e203d5fd9 100644 --- a/lib/private/Files/Cache/QuerySearchHelper.php +++ b/lib/private/Files/Cache/QuerySearchHelper.php @@ -199,12 +199,8 @@ class QuerySearchHelper { */ public function getCachesAndMountPointsForSearch(IRootFolder $root, string $path, bool $limitToHome = false): array { $rootLength = strlen($path); - $storage = null; - if (method_exists($root, 'getMount')) { - /** @var IMountPoint $mount */ - $mount = $root->getMount($path); - $storage = $mount->getStorage(); - } + $mount = $root->getMount($path); + $storage = $mount->getStorage(); if ($storage === null) { return []; } @@ -221,8 +217,7 @@ class QuerySearchHelper { /** @var IMountPoint[] $mountByMountPoint */ $mountByMountPoint = ['' => $mount]; - if (!$limitToHome && method_exists($root, 'getMountsIn')) { - /** @var IMountPoint[] $mounts */ + if (!$limitToHome) { $mounts = $root->getMountsIn($path); foreach ($mounts as $mount) { $storage = $mount->getStorage(); -- cgit v1.2.3