summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-07-04 23:36:06 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2023-07-04 23:36:06 +0200
commit1eb9f1874d37b024f4faa0636dbfd961c803490e (patch)
tree90101bd069bc55e2fc2a2f42f4975cef33916258 /lib
parent2930f890d64c525f437154e2a18a152f9b52cfbe (diff)
downloadnextcloud-server-1eb9f1874d37b024f4faa0636dbfd961c803490e.tar.gz
nextcloud-server-1eb9f1874d37b024f4faa0636dbfd961c803490e.zip
fix: adjust to PHP level and codebase
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Node/Folder.php6
-rw-r--r--lib/private/Files/Node/Node.php8
-rw-r--r--lib/private/Files/Node/Root.php3
3 files changed, 11 insertions, 6 deletions
diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php
index b376d4673e4..5669f2a4b45 100644
--- a/lib/private/Files/Node/Folder.php
+++ b/lib/private/Files/Node/Folder.php
@@ -109,7 +109,7 @@ class Folder extends Node implements \OCP\Files\Folder {
}, $folderContent);
}
- protected function createNode(string $path, ?FileInfo $info = null, bool $infoHasSubMountsIncluded = true): INode {
+ protected function createNode(string $path, ?FileInfo $info = null): INode {
if (is_null($info)) {
$isDir = $this->view->is_dir($path);
} else {
@@ -326,7 +326,7 @@ class Folder extends Node implements \OCP\Files\Folder {
* @param int $id
* @return array
*/
- protected function getByIdInRootMount(int $id): 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
@@ -335,7 +335,7 @@ class Folder extends Node implements \OCP\Files\Folder {
}
$mount = $this->root->getMount('');
$storage = $mount->getStorage();
- $cacheEntry = $storage?->getCache($this->path)->get($id);
+ $cacheEntry = $storage ? $storage->getCache($this->path)->get($id) : null;
if (!$cacheEntry) {
return [];
}
diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php
index 7c8c0197834..5af317b2a49 100644
--- a/lib/private/Files/Node/Node.php
+++ b/lib/private/Files/Node/Node.php
@@ -72,7 +72,7 @@ class Node implements INode {
* @param string $path
* @param FileInfo $fileInfo
*/
- public function __construct($root, $view, $path, $fileInfo = null, ?Node $parent = null) {
+ public function __construct(IRootFolder $root, $view, $path, $fileInfo = null, ?Node $parent = null) {
if (Filesystem::normalizePath($view->getRoot()) !== '/') {
throw new PreConditionNotMetException('The view passed to the node should not have any fake root set');
}
@@ -285,7 +285,11 @@ class Node implements INode {
return $this->getFileInfo()->isCreatable();
}
- public function getParent(): INode|IRootFolder {
+ /**
+ * @return INode|IRootFolder
+ * @throws NotFoundException
+ */
+ public function getParent() {
if ($this->parent === null) {
$newPath = dirname($this->path);
if ($newPath === '' || $newPath === '.' || $newPath === '/') {
diff --git a/lib/private/Files/Node/Root.php b/lib/private/Files/Node/Root.php
index 6b82c9f7250..e102d993c10 100644
--- a/lib/private/Files/Node/Root.php
+++ b/lib/private/Files/Node/Root.php
@@ -336,9 +336,10 @@ class Root extends Folder implements IRootFolder {
}
/**
+ * @return INode|IRootFolder
* @throws \OCP\Files\NotFoundException
*/
- public function getParent(): INode|IRootFolder {
+ public function getParent() {
throw new NotFoundException();
}