]> source.dussan.org Git - nextcloud-server.git/commitdiff
Properly hint exceptions thrown by getUserFolder 20334/head
authorJulius Härtl <jus@bitgrid.net>
Fri, 3 Apr 2020 10:17:47 +0000 (12:17 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 6 Apr 2020 16:47:55 +0000 (16:47 +0000)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
lib/private/Files/Node/Root.php
lib/public/Files/IRootFolder.php

index 948715aec04bbea35c15a1f796d8cb9012317614..357c22aa45ff2365affee9b54dc188904875c0ee 100644 (file)
@@ -35,6 +35,7 @@ use OC\Cache\CappedMemoryCache;
 use OC\Files\Mount\Manager;
 use OC\Files\Mount\MountPoint;
 use OC\Hooks\PublicEmitter;
+use OC\User\NoUserException;
 use OCP\Files\Config\IUserMountCache;
 use OCP\Files\IRootFolder;
 use OCP\Files\NotFoundException;
@@ -352,7 +353,8 @@ class Root extends Folder implements IRootFolder {
         *
         * @param string $userId user ID
         * @return \OCP\Files\Folder
-        * @throws \OC\User\NoUserException
+        * @throws NoUserException
+        * @throws NotPermittedException
         */
        public function getUserFolder($userId) {
                $userObject = $this->userManager->get($userId);
@@ -367,7 +369,7 @@ class Root extends Folder implements IRootFolder {
                                        'app' => 'files',
                                ]
                        );
-                       throw new \OC\User\NoUserException('Backends provided no user object');
+                       throw new NoUserException('Backends provided no user object');
                }
 
                $userId = $userObject->getUID();
index 5304414ae7b542289d4a907b3dae0d2d3aa0d72a..0d568f9045e0c971aa2bc36a41174130b89684bc 100644 (file)
@@ -25,6 +25,7 @@
 namespace OCP\Files;
 
 use OC\Hooks\Emitter;
+use OC\User\NoUserException;
 
 /**
  * Interface IRootFolder
@@ -39,6 +40,9 @@ interface IRootFolder extends Folder, Emitter {
         *
         * @param string $userId user ID
         * @return \OCP\Files\Folder
+        * @throws NoUserException
+        * @throws NotPermittedException
+        *
         * @since 8.2.0
         */
        public function getUserFolder($userId);