From 7e44668621b55404b4133ece15eee25e9e9706c2 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 29 Jan 2021 16:16:03 +0100 Subject: [PATCH] dont return private storage interface from public mount interface Signed-off-by: Robin Appelman --- apps/files_sharing/lib/SharedStorage.php | 6 +----- lib/private/Files/Storage/Storage.php | 2 +- lib/private/Files/Storage/Wrapper/Jail.php | 2 +- lib/private/Files/Storage/Wrapper/Wrapper.php | 2 +- lib/public/Files/Mount/IMountPoint.php | 2 +- lib/public/Files/Storage/IStorage.php | 4 +++- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index eb0af41998336..a1217f9558a36 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -40,6 +40,7 @@ use OC\Files\Storage\Wrapper\PermissionsMask; use OC\User\NoUserException; use OCP\Constants; +use OCP\Files\Cache\ICache; use OCP\Files\Cache\ICacheEntry; use OCP\Files\NotFoundException; use OCP\Files\Storage\IDisableEncryptionStorage; @@ -369,11 +370,6 @@ public function getItemType(): string { return $this->superShare->getNodeType(); } - /** - * @param string $path - * @param null $storage - * @return Cache - */ public function getCache($path = '', $storage = null) { if ($this->cache) { return $this->cache; diff --git a/lib/private/Files/Storage/Storage.php b/lib/private/Files/Storage/Storage.php index 73793aa31fbcf..94f1ee6243043 100644 --- a/lib/private/Files/Storage/Storage.php +++ b/lib/private/Files/Storage/Storage.php @@ -38,7 +38,7 @@ interface Storage extends \OCP\Files\Storage { * get a cache instance for the storage * * @param string $path - * @param \OC\Files\Storage\Storage (optional) the storage to pass to the cache + * @param \OC\Files\Storage\Storage|null (optional) the storage to pass to the cache * @return \OC\Files\Cache\Cache */ public function getCache($path = '', $storage = null); diff --git a/lib/private/Files/Storage/Wrapper/Jail.php b/lib/private/Files/Storage/Wrapper/Jail.php index 276f00af33cd6..aa6cbf7e40cf0 100644 --- a/lib/private/Files/Storage/Wrapper/Jail.php +++ b/lib/private/Files/Storage/Wrapper/Jail.php @@ -396,7 +396,7 @@ public function hasUpdated($path, $time) { * get a cache instance for the storage * * @param string $path - * @param \OC\Files\Storage\Storage (optional) the storage to pass to the cache + * @param \OC\Files\Storage\Storage|null (optional) the storage to pass to the cache * @return \OC\Files\Cache\Cache */ public function getCache($path = '', $storage = null) { diff --git a/lib/private/Files/Storage/Wrapper/Wrapper.php b/lib/private/Files/Storage/Wrapper/Wrapper.php index cffe610c6c26a..d45d5e9f9f098 100644 --- a/lib/private/Files/Storage/Wrapper/Wrapper.php +++ b/lib/private/Files/Storage/Wrapper/Wrapper.php @@ -386,7 +386,7 @@ public function hasUpdated($path, $time) { * get a cache instance for the storage * * @param string $path - * @param \OC\Files\Storage\Storage (optional) the storage to pass to the cache + * @param \OC\Files\Storage\Storage|null (optional) the storage to pass to the cache * @return \OC\Files\Cache\Cache */ public function getCache($path = '', $storage = null) { diff --git a/lib/public/Files/Mount/IMountPoint.php b/lib/public/Files/Mount/IMountPoint.php index 7315fd97035dd..9b55c76445171 100644 --- a/lib/public/Files/Mount/IMountPoint.php +++ b/lib/public/Files/Mount/IMountPoint.php @@ -48,7 +48,7 @@ public function setMountPoint($mountPoint); /** * Get the storage that is mounted * - * @return \OC\Files\Storage\Storage + * @return \OCP\Files\Storage\IStorage * @since 8.0.0 */ public function getStorage(); diff --git a/lib/public/Files/Storage/IStorage.php b/lib/public/Files/Storage/IStorage.php index 5e70e319c40b9..ee26dd9c66bb4 100644 --- a/lib/public/Files/Storage/IStorage.php +++ b/lib/public/Files/Storage/IStorage.php @@ -433,10 +433,12 @@ public function setAvailability($isAvailable); public function getOwner($path); /** + * @param string $path + * @param IStorage|null $storage * @return ICache * @since 9.0.0 */ - public function getCache(); + public function getCache($path = '', $storage = null); /** * @return IPropagator