diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 8f8fb6e3d5e60..a143c6188a1fb 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -1976,7 +1976,6 @@ - root->get($this->getFullPath($path))]]> createNode($file->getPath(), $file); }, $files)]]> @@ -1985,7 +1984,6 @@ - @@ -2046,7 +2044,6 @@ - createNode($fullPath, $fileInfo, false)]]> mountManager->findByNumericId($numericId)]]> mountManager->findByStorageId($storageId)]]> mountManager->findIn($mountPoint)]]> @@ -2054,7 +2051,6 @@ - diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index d8344f3d5bd16..a894c69649a4f 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -103,26 +103,15 @@ protected function createNode(string $path, ?FileInfo $info = null, bool $infoHa } } - /** - * Get the node at $path - * - * @param string $path - * @return \OC\Files\Node\Node - * @throws \OCP\Files\NotFoundException - */ public function get($path) { return $this->root->get($this->getFullPath($path)); } - /** - * @param string $path - * @return bool - */ public function nodeExists($path) { try { $this->get($path); return true; - } catch (NotFoundException $e) { + } catch (NotFoundException|NotPermittedException) { return false; } } diff --git a/lib/private/Files/Node/LazyFolder.php b/lib/private/Files/Node/LazyFolder.php index 83ed7e534a718..5879748d9514d 100644 --- a/lib/private/Files/Node/LazyFolder.php +++ b/lib/private/Files/Node/LazyFolder.php @@ -134,9 +134,6 @@ public function unMount($mount) { $this->__call(__FUNCTION__, func_get_args()); } - /** - * @inheritDoc - */ public function get($path) { return $this->getRootFolder()->get($this->getFullPath($path)); } @@ -422,9 +419,6 @@ public function getDirectoryListing() { return $this->__call(__FUNCTION__, func_get_args()); } - /** - * @inheritDoc - */ public function nodeExists($path) { return $this->__call(__FUNCTION__, func_get_args()); } diff --git a/lib/private/Files/Node/Root.php b/lib/private/Files/Node/Root.php index dbe03a4cfbfb6..1686051131dac 100644 --- a/lib/private/Files/Node/Root.php +++ b/lib/private/Files/Node/Root.php @@ -171,12 +171,6 @@ public function unMount($mount) { $this->mountManager->remove($mount); } - /** - * @param string $path - * @return Node - * @throws \OCP\Files\NotPermittedException - * @throws \OCP\Files\NotFoundException - */ public function get($path) { $path = $this->normalizePath($path); if ($this->isValidPath($path)) { diff --git a/lib/public/Files/Folder.php b/lib/public/Files/Folder.php index 3f05ff49890af..3128a17c10c73 100644 --- a/lib/public/Files/Folder.php +++ b/lib/public/Files/Folder.php @@ -60,6 +60,7 @@ public function getDirectoryListing(); * @param string $path relative path of the file or folder * @return \OCP\Files\Node * @throws \OCP\Files\NotFoundException + * @throws \OCP\Files\NotPermittedException * @since 6.0.0 */ public function get($path);