summaryrefslogtreecommitdiffstats
path: root/lib/private/Files
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-06-17 00:15:49 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2023-06-21 16:53:20 +0200
commit088a0eea29bc037f3f7c7a54ef4d411ddcf1fedd (patch)
treebfef0a845837bd85e93bf4df33d3fd430eaf3354 /lib/private/Files
parent71e41ffeeb4367f3253f16aba3bf21b80c09ca2b (diff)
downloadnextcloud-server-088a0eea29bc037f3f7c7a54ef4d411ddcf1fedd.tar.gz
nextcloud-server-088a0eea29bc037f3f7c7a54ef4d411ddcf1fedd.zip
ci: pro forma check of existence of internal method
createNode() is protected and used by Folder, but being an internal-only method it shall not be exposed in the Folder or IRootFolder interface. Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/Files')
-rw-r--r--lib/private/Files/Node/Folder.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php
index 41bac26248b..6a009bded96 100644
--- a/lib/private/Files/Node/Folder.php
+++ b/lib/private/Files/Node/Folder.php
@@ -40,6 +40,7 @@ use OC\Files\Utils\PathHelper;
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\FileInfo;
use OCP\Files\Mount\IMountPoint;
+use OCP\Files\Node as INode;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
use OCP\Files\Search\ISearchBinaryOperator;
@@ -109,12 +110,7 @@ class Folder extends Node implements \OCP\Files\Folder {
}, $folderContent);
}
- /**
- * @param string $path
- * @param FileInfo $info
- * @return File|Folder
- */
- protected function createNode($path, FileInfo $info = null, bool $infoHasSubMountsIncluded = true) {
+ protected function createNode(string $path, ?FileInfo $info = null, bool $infoHasSubMountsIncluded = true): INode {
if (is_null($info)) {
$isDir = $this->view->is_dir($path);
} else {
@@ -330,6 +326,12 @@ class Folder extends Node implements \OCP\Files\Folder {
* @return array
*/
protected function getByIdInRootMount(int $id): array {
+ if (!method_exists($this->root, 'createNode')) {
+ // Always expected to be false. Being a method of Folder, this is
+ // always implemented. For it is an internal method and should not
+ // be exposed and made public, it is not part of an interface.
+ return [];
+ }
$mount = $this->root->getMount('');
$storage = $mount->getStorage();
$cacheEntry = $storage?->getCache($this->path)->get($id);
@@ -385,7 +387,7 @@ class Folder extends Node implements \OCP\Files\Folder {
/**
* @param int $limit
* @param int $offset
- * @return \OCP\Files\Node[]
+ * @return INode[]
*/
public function getRecent($limit, $offset = 0) {
$filterOutNonEmptyFolder = new SearchBinaryOperator(