]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix psalm issues 30682/head
authorCarl Schwan <carl@carlschwan.eu>
Thu, 13 Jan 2022 11:30:27 +0000 (12:30 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Fri, 14 Jan 2022 14:16:59 +0000 (14:16 +0000)
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
apps/workflowengine/lib/Check/FileSystemTags.php
lib/private/Files/Storage/Wrapper/Wrapper.php

index 5312c763ec70e48ef2fe694ede0955d2ed299b36..944552bef595889890df652853f44da055c4615c 100644 (file)
@@ -139,7 +139,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();
index 94c497793ac7340160e53cb6f4df50458cc208ef..586262ddab46d979ce0e5e0a7029311353c5377b 100644 (file)
@@ -499,19 +499,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;