diff --git a/lib/private/Files/Mount/Manager.php b/lib/private/Files/Mount/Manager.php index 044fd98dd222f..46697a7940f19 100644 --- a/lib/private/Files/Mount/Manager.php +++ b/lib/private/Files/Mount/Manager.php @@ -66,10 +66,7 @@ public function moveMount(string $mountPoint, string $target) { } /** - * Find the mount for $path - * - * @param string $path - * @return IMountPoint + * Find/return the mount for $path */ public function find(string $path): IMountPoint { $this->setupManager->setupForPath($path); @@ -79,8 +76,6 @@ public function find(string $path): IMountPoint { return $this->pathCache[$path]; } - - if (count($this->mounts) === 0) { $this->setupManager->setupRoot(); if (count($this->mounts) === 0) { diff --git a/lib/public/Files/Mount/IMountManager.php b/lib/public/Files/Mount/IMountManager.php index 43a771c07ce82..abbe1a085d0a2 100644 --- a/lib/public/Files/Mount/IMountManager.php +++ b/lib/public/Files/Mount/IMountManager.php @@ -43,13 +43,15 @@ public function removeMount(string $mountPoint); public function moveMount(string $mountPoint, string $target); /** - * Find the mount for $path + * Finds and returns the mount point for a given path. * - * @param string $path - * @return IMountPoint + * @param string $path The filesystem path to search for a mount. + * @return IMountPoint The found mount point. + * @throws \OCP\Files\NotFoundException If no mount is found for the path. + * @throws \Exception If no mounts exist after setup. * @since 8.2.0 */ - public function find(string $path): ?IMountPoint; + public function find(string $path): IMountPoint; /** * Find all mounts in $path