diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-09-30 11:19:53 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-09-30 11:21:42 +0200 |
commit | 6ef05bafebc8782d250918e7d36d78eb81a8baea (patch) | |
tree | 7d018221c9d3bf694408a502d8352051b2eb353e | |
parent | da591eaec3050ab02b4a74d1304db78335eeb7fa (diff) | |
download | nextcloud-server-6ef05bafebc8782d250918e7d36d78eb81a8baea.tar.gz nextcloud-server-6ef05bafebc8782d250918e7d36d78eb81a8baea.zip |
fix: Fix test of IConstructableStorage implentation by storage classesfix/fix-storage-interface-check
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r-- | apps/files_external/lib/Config/ConfigAdapter.php | 2 | ||||
-rw-r--r-- | lib/private/Files/Storage/StorageFactory.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/apps/files_external/lib/Config/ConfigAdapter.php b/apps/files_external/lib/Config/ConfigAdapter.php index b2246226d33..a55406b302e 100644 --- a/apps/files_external/lib/Config/ConfigAdapter.php +++ b/apps/files_external/lib/Config/ConfigAdapter.php @@ -64,7 +64,7 @@ class ConfigAdapter implements IMountProvider { */ private function constructStorage(StorageConfig $storageConfig): IStorage { $class = $storageConfig->getBackend()->getStorageClass(); - if (!$class instanceof IConstructableStorage) { + if (!is_a($class, IConstructableStorage::class, true)) { \OCP\Server::get(LoggerInterface::class)->warning('Building a storage not implementing IConstructableStorage is deprecated since 31.0.0', ['class' => $class]); } $storage = new $class($storageConfig->getBackendOptions()); diff --git a/lib/private/Files/Storage/StorageFactory.php b/lib/private/Files/Storage/StorageFactory.php index 6b5834049bf..252f85e03d6 100644 --- a/lib/private/Files/Storage/StorageFactory.php +++ b/lib/private/Files/Storage/StorageFactory.php @@ -52,7 +52,7 @@ class StorageFactory implements IStorageFactory { * @return IStorage */ public function getInstance(IMountPoint $mountPoint, $class, $arguments): IStorage { - if (!($class instanceof IConstructableStorage)) { + if (!is_a($class, IConstructableStorage::class, true)) { \OCP\Server::get(LoggerInterface::class)->warning('Building a storage not implementing IConstructableStorage is deprecated since 31.0.0', ['class' => $class]); } return $this->wrap($mountPoint, new $class($arguments)); |