Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docs for Folder.get and call for Folder.nodeExists #48455

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
13 changes: 1 addition & 12 deletions lib/private/Files/Node/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
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
Loading