mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
Fix psalm issues
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
parent
695165260f
commit
cbf9064b8e
2 changed files with 10 additions and 7 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue