Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
docs: Folder.get throws a NotPermittedException exception
Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb committed Sep 30, 2024
commit 3db20c8b007f6f69d8ddd6933b81b425b72aae4a
4 changes: 0 additions & 4 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -2046,15 +2044,13 @@
<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>
<code><![CDATA[$this->user]]></code>
</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>
Expand Down
11 changes: 0 additions & 11 deletions lib/private/Files/Node/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,10 @@ 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);
Expand Down
6 changes: 0 additions & 6 deletions lib/private/Files/Node/LazyFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down Expand Up @@ -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());
}
Expand Down
6 changes: 0 additions & 6 deletions lib/private/Files/Node/Root.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
1 change: 1 addition & 0 deletions lib/public/Files/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down