]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix: adjust to PHP level and codebase 39154/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Tue, 4 Jul 2023 21:36:06 +0000 (23:36 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Tue, 4 Jul 2023 21:36:06 +0000 (23:36 +0200)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
lib/private/Files/Node/Folder.php
lib/private/Files/Node/Node.php
lib/private/Files/Node/Root.php

index b376d4673e411326f27adc29e012ec758eb27ccc..5669f2a4b4599d076b12c433d3ac2ccb240d2df0 100644 (file)
@@ -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 [];
                }
index 7c8c01978340704bd940790c87b0ce4ee8414dd1..5af317b2a498f97dfe54445e41922403570f2c72 100644 (file)
@@ -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 === '/') {
index 6b82c9f7250a80a6e002304772583096d6e3c8dd..e102d993c108482285bedd34a0d69480ea3cbc98 100644 (file)
@@ -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();
        }