diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-01-13 12:30:27 +0100 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-01-13 12:30:27 +0100 |
commit | cbf9064b8ecde6f497146f6711fff83307a0730f (patch) | |
tree | be8be8de69e175577532fb5e653936c1a444af4b | |
parent | 695165260f26b2f5b5584e619e54741db1a2d9cc (diff) | |
download | nextcloud-server-cbf9064b8ecde6f497146f6711fff83307a0730f.tar.gz nextcloud-server-cbf9064b8ecde6f497146f6711fff83307a0730f.zip |
Fix psalm issues
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
-rw-r--r-- | apps/workflowengine/lib/Check/FileSystemTags.php | 5 | ||||
-rw-r--r-- | lib/private/Files/Storage/Wrapper/Wrapper.php | 12 |
2 files changed, 10 insertions, 7 deletions
diff --git a/apps/workflowengine/lib/Check/FileSystemTags.php b/apps/workflowengine/lib/Check/FileSystemTags.php index d3f02729f2f..008f47eca78 100644 --- a/apps/workflowengine/lib/Check/FileSystemTags.php +++ b/apps/workflowengine/lib/Check/FileSystemTags.php @@ -144,7 +144,10 @@ class FileSystemTags implements ICheck, IFileCheck { if ($groupFolderStorage === null) { throw new \LogicException('Should not happen: Storage is instance of GroupFolderStorage but no group folder storage found while unwrapping.'); } - /** @psalm-suppress UndefinedMethod */ + /** + * @psalm-suppress UndefinedDocblockClass + * @psalm-suppress UndefinedInterfaceMethod + */ $cacheId = $cache->getNumericStorageId() . '/' . $groupFolderStorage->getFolderId(); } else { $cacheId = $cache->getNumericStorageId(); diff --git a/lib/private/Files/Storage/Wrapper/Wrapper.php b/lib/private/Files/Storage/Wrapper/Wrapper.php index b44db7c13ce..6bc66bf9c89 100644 --- a/lib/private/Files/Storage/Wrapper/Wrapper.php +++ b/lib/private/Files/Storage/Wrapper/Wrapper.php @@ -498,19 +498,19 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IWriteStrea } /** - * @template T of IStorage - * @param class-string<T> $class - * @return ?T + * @psalm-template T of IStorage + * @psalm-param class-string<T> $class + * @psalm-return T|null */ - public function getInstanceOfStorage(string $class): ?IStorage { + public function getInstanceOfStorage(string $class) { $storage = $this; - while ($storage->instanceOfStorage(Wrapper::class)) { + while ($storage instanceof Wrapper) { if ($storage instanceof $class) { break; } $storage = $storage->getWrapperStorage(); } - if (!is_a($storage, $class)) { + if (!($storage instanceof $class)) { return null; } return $storage; |