mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
fix: adjust to PHP level and codebase
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
2930f890d6
commit
1eb9f1874d
3 changed files with 11 additions and 6 deletions
|
|
@ -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 [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 === '/') {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue