diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2023-06-17 00:15:49 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2023-07-04 23:12:58 +0200 |
commit | c2fdee7f6e790051c1a9118ba5a7dfc4619c2711 (patch) | |
tree | 000d9cc96f8f17139c63cc9ca98f7c9f3fa4a9da /lib | |
parent | 481cbafae30dc5fdaa44615a898375be3b0cd89f (diff) | |
download | nextcloud-server-c2fdee7f6e790051c1a9118ba5a7dfc4619c2711.tar.gz nextcloud-server-c2fdee7f6e790051c1a9118ba5a7dfc4619c2711.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')
-rw-r--r-- | lib/private/Files/Node/Folder.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index 9e443105ae4..4f5ac07a15a 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -39,6 +39,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; @@ -108,12 +109,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) { + protected function createNode(string $path, ?FileInfo $info = null, bool $infoHasSubMountsIncluded = true): INode { if (is_null($info)) { $isDir = $this->view->is_dir($path); } else { @@ -329,6 +325,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); @@ -384,7 +386,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( |