Skip to content

Commit

Permalink
ci: pro forma check of existence of internal method
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
blizzz authored and backportbot-nextcloud[bot] committed Jun 23, 2023
1 parent 09c4ba2 commit 29e11a4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/private/Files/Node/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
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;
Expand Down Expand Up @@ -109,12 +110,7 @@ public function getDirectoryListing() {
}, $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 {
Expand Down Expand Up @@ -330,6 +326,12 @@ protected function getAppDataDirectoryName(): string {
* @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);
Expand Down Expand Up @@ -385,7 +387,7 @@ public function getNonExistingName($name) {
/**
* @param int $limit
* @param int $offset
* @return \OCP\Files\Node[]
* @return INode[]
*/
public function getRecent($limit, $offset = 0) {
$filterOutNonEmptyFolder = new SearchBinaryOperator(
Expand Down

0 comments on commit 29e11a4

Please sign in to comment.