diff options
author | Daniel <mail@danielkesselberg.de> | 2024-09-30 23:02:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-30 23:02:53 +0200 |
commit | 99d507c2593c6c60081ff16586ba3b68237ca0b0 (patch) | |
tree | a3842e6cc91c5cac40abdbec28984e7e563b6670 | |
parent | b05c2dc08e0b48ec300193cf1b2485e2de0d6f95 (diff) | |
parent | fbaa4cc5e07d1c9173a04887df018f4d4d4a3b49 (diff) | |
download | nextcloud-server-99d507c2593c6c60081ff16586ba3b68237ca0b0.tar.gz nextcloud-server-99d507c2593c6c60081ff16586ba3b68237ca0b0.zip |
Merge pull request #48455 from nextcloud/update-phpdoc-for-folder-get
update docs for Folder.get and call for Folder.nodeExists
-rw-r--r-- | build/psalm-baseline.xml | 4 | ||||
-rw-r--r-- | lib/private/Files/Node/Folder.php | 13 | ||||
-rw-r--r-- | lib/private/Files/Node/LazyFolder.php | 6 | ||||
-rw-r--r-- | lib/private/Files/Node/Root.php | 6 | ||||
-rw-r--r-- | lib/public/Files/Folder.php | 1 |
5 files changed, 2 insertions, 28 deletions
diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 8f8fb6e3d5e..a143c6188a1 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -1976,7 +1976,6 @@ </file> <file src="lib/private/Files/Node/Folder.php"> <LessSpecificReturnStatement> - <code><![CDATA[$this->root->get($this->getFullPath($path))]]></code> <code><![CDATA[array_map(function (FileInfo $file) { return $this->createNode($file->getPath(), $file); }, $files)]]></code> @@ -1985,7 +1984,6 @@ <code><![CDATA[$node]]></code> </MoreSpecificImplementedParamType> <MoreSpecificReturnType> - <code><![CDATA[\OC\Files\Node\Node]]></code> <code><![CDATA[\OC\Files\Node\Node[]]]></code> </MoreSpecificReturnType> </file> @@ -2046,7 +2044,6 @@ <file src="lib/private/Files/Node/Root.php"> <LessSpecificReturnStatement> <code><![CDATA[$folders]]></code> - <code><![CDATA[$this->createNode($fullPath, $fileInfo, false)]]></code> <code><![CDATA[$this->mountManager->findByNumericId($numericId)]]></code> <code><![CDATA[$this->mountManager->findByStorageId($storageId)]]></code> <code><![CDATA[$this->mountManager->findIn($mountPoint)]]></code> @@ -2054,7 +2051,6 @@ </LessSpecificReturnStatement> <MoreSpecificReturnType> <code><![CDATA[MountPoint[]]]></code> - <code><![CDATA[Node]]></code> <code><![CDATA[\OC\Files\Mount\MountPoint[]]]></code> <code><![CDATA[\OC\Files\Mount\MountPoint[]]]></code> <code><![CDATA[\OC\User\User]]></code> diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index d8344f3d5bd..a894c69649a 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -103,26 +103,15 @@ class Folder extends Node implements \OCP\Files\Folder { } } - /** - * 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 83ed7e534a7..5879748d951 100644 --- a/lib/private/Files/Node/LazyFolder.php +++ b/lib/private/Files/Node/LazyFolder.php @@ -134,9 +134,6 @@ class LazyFolder implements Folder { $this->__call(__FUNCTION__, func_get_args()); } - /** - * @inheritDoc - */ public function get($path) { return $this->getRootFolder()->get($this->getFullPath($path)); } @@ -422,9 +419,6 @@ class LazyFolder implements Folder { 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 dbe03a4cfbf..1686051131d 100644 --- a/lib/private/Files/Node/Root.php +++ b/lib/private/Files/Node/Root.php @@ -171,12 +171,6 @@ class Root extends Folder implements IRootFolder { $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 3f05ff49890..3128a17c10c 100644 --- a/lib/public/Files/Folder.php +++ b/lib/public/Files/Folder.php @@ -60,6 +60,7 @@ interface Folder extends Node { * @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); |