if (!$storage) {
$storage = $this;
}
- /** @psalm-suppress NoInterfaceProperties The isset check is safe */
+ if (!$storage->instanceOfStorage(self::class)) {
+ throw new \InvalidArgumentException('Storage is not of the correct class');
+ }
if (!isset($storage->scanner)) {
$storage->scanner = new Scanner($storage);
}
- /** @psalm-suppress NoInterfaceProperties Legacy stuff */
return $storage->scanner;
}
if (!$storage) {
$storage = $this;
}
- /** @psalm-suppress NoInterfaceProperties The isset check is safe */
+ if (!$storage->instanceOfStorage(self::class)) {
+ throw new \InvalidArgumentException('Storage is not of the correct class');
+ }
if (!isset($storage->propagator)) {
$config = \OC::$server->getSystemConfig();
$storage->propagator = new Propagator($storage, \OC::$server->getDatabaseConnection(), ['appdata_' . $config->getValue('instanceid')]);
}
- /** @psalm-suppress NullableReturnStatement False-positive, as the if above avoids this being null */
return $storage->propagator;
}
if (!$storage) {
$storage = $this;
}
- /** @psalm-suppress NoInterfaceProperties The isset check is safe */
+ if (!$storage->instanceOfStorage(self::class)) {
+ throw new \InvalidArgumentException('Storage is not of the correct class');
+ }
if (!isset($storage->updater)) {
$storage->updater = new Updater($storage);
}
- /** @psalm-suppress NullableReturnStatement False-positive, as the if above avoids this being null */
return $storage->updater;
}