diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2023-06-15 23:21:56 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2023-07-04 23:10:33 +0200 |
commit | 481cbafae30dc5fdaa44615a898375be3b0cd89f (patch) | |
tree | a83f74177acabc82340a5051e26b148abff5c3a2 /lib/private/Files/Node | |
parent | d5b69c16984163ba0f8c0a8001cf31fbba167b5f (diff) | |
download | nextcloud-server-481cbafae30dc5fdaa44615a898375be3b0cd89f.tar.gz nextcloud-server-481cbafae30dc5fdaa44615a898375be3b0cd89f.zip |
refactor: declare getMount() and getMountsIn() at IRootFolder
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/Files/Node')
-rw-r--r-- | lib/private/Files/Node/Folder.php | 8 | ||||
-rw-r--r-- | lib/private/Files/Node/LazyFolder.php | 7 | ||||
-rw-r--r-- | lib/private/Files/Node/Root.php | 8 |
3 files changed, 8 insertions, 15 deletions
diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index 79a8b88fc88..9e443105ae4 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -329,12 +329,8 @@ class Folder extends Node implements \OCP\Files\Folder { * @return array */ protected function getByIdInRootMount(int $id): array { - $storage = null; - if (\method_exists($this->root, 'getMount')) { - /** @var IMountPoint $mount */ - $mount = $this->root->getMount(''); - $storage = $mount->getStorage(); - } + $mount = $this->root->getMount(''); + $storage = $mount->getStorage(); $cacheEntry = $storage?->getCache($this->path)->get($id); if (!$cacheEntry) { return []; diff --git a/lib/private/Files/Node/LazyFolder.php b/lib/private/Files/Node/LazyFolder.php index 1bae0f52e59..fc17ed2eb52 100644 --- a/lib/private/Files/Node/LazyFolder.php +++ b/lib/private/Files/Node/LazyFolder.php @@ -28,6 +28,7 @@ namespace OC\Files\Node; use OC\Files\Utils\PathHelper; use OCP\Constants; +use OCP\Files\Mount\IMountPoint; /** * Class LazyFolder @@ -110,14 +111,14 @@ class LazyFolder implements \OCP\Files\Folder { /** * @inheritDoc */ - public function getMount($mountPoint) { + public function getMount(string $mountPoint): IMountPoint { return $this->__call(__FUNCTION__, func_get_args()); } /** - * @inheritDoc + * @return IMountPoint[] */ - public function getMountsIn($mountPoint) { + public function getMountsIn(string $mountPoint): array { return $this->__call(__FUNCTION__, func_get_args()); } diff --git a/lib/private/Files/Node/Root.php b/lib/private/Files/Node/Root.php index 2de71c1500e..6b82c9f7250 100644 --- a/lib/private/Files/Node/Root.php +++ b/lib/private/Files/Node/Root.php @@ -154,11 +154,7 @@ class Root extends Folder implements IRootFolder { $this->mountManager->addMount($mount); } - /** - * @param string $mountPoint - * @return \OC\Files\Mount\MountPoint - */ - public function getMount($mountPoint) { + public function getMount(string $mountPoint): IMountPoint { return $this->mountManager->find($mountPoint); } @@ -166,7 +162,7 @@ class Root extends Folder implements IRootFolder { * @param string $mountPoint * @return \OC\Files\Mount\MountPoint[] */ - public function getMountsIn($mountPoint) { + public function getMountsIn(string $mountPoint): array { return $this->mountManager->findIn($mountPoint); } |