diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-09-15 18:04:39 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-09-16 18:11:38 +0200 |
commit | 5d01e0a73c9e27cdec7e51e22ed32707ffca7170 (patch) | |
tree | daa08503edfbabf6a112c9b694cc6fc9d2bff3ca | |
parent | 492e6997d8ed5077c2dd36b690a10eef4beb9324 (diff) | |
download | nextcloud-server-5d01e0a73c9e27cdec7e51e22ed32707ffca7170.tar.gz nextcloud-server-5d01e0a73c9e27cdec7e51e22ed32707ffca7170.zip |
chore: psalm-suppress legacy code weirdness
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r-- | lib/private/Files/Storage/Common.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php index 01b33648ac0..fa8521790f3 100644 --- a/lib/private/Files/Storage/Common.php +++ b/lib/private/Files/Storage/Common.php @@ -353,27 +353,37 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage { /** * get a propagator instance for the cache * - * @param \OC\Files\Storage\Storage (optional) the storage to pass to the watcher - * @return \OC\Files\Cache\Propagator + * @param \OC\Files\Storage\Storage $storage (optional) the storage to pass to the watcher + * @return Propagator */ public function getPropagator($storage = null) { if (!$storage) { $storage = $this; } + /** @psalm-suppress NoInterfaceProperties The isset check is safe */ 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; } + /** + * get a propagator instance for the cache + * + * @param \OC\Files\Storage\Storage $storage (optional) the storage to pass to the watcher + * @return Updater + */ public function getUpdater($storage = null) { if (!$storage) { $storage = $this; } + /** @psalm-suppress NoInterfaceProperties The isset check is safe */ 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; } |