]> source.dussan.org Git - nextcloud-server.git/commitdiff
Properly hint exceptions thrown by getUserFolder 20284/head
authorJulius Härtl <jus@bitgrid.net>
Fri, 3 Apr 2020 10:17:47 +0000 (12:17 +0200)
committerJulius Härtl <jus@bitgrid.net>
Fri, 3 Apr 2020 21:06:26 +0000 (23:06 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
lib/private/Files/Node/Root.php
lib/public/Files/IRootFolder.php

index 843069ff50d54f11cbdecd4cc6425a1ccb34beac..13c715816efba5a4437d7614039b4004f5f0b3d8 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);