From 34cd91cc86a89d623aa811f11316640db12ea91c Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Wed, 1 Oct 2025 16:18:11 +0200 Subject: [PATCH] refactor: Fix some easy psalm issues in Files Signed-off-by: Carl Schwan --- build/psalm-baseline.xml | 27 ------------------- .../Files/Storage/LocalRootStorage.php | 1 + .../Files/Storage/Wrapper/Encoding.php | 6 +---- 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 92479b887aa..e30b5dccee1 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -3614,33 +3614,6 @@ - - - scanner]]> - scanner]]> - - - - - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - namesCache]]> - - diff --git a/lib/private/Files/Storage/LocalRootStorage.php b/lib/private/Files/Storage/LocalRootStorage.php index 2e0645e092a..d8d0fc2c75c 100644 --- a/lib/private/Files/Storage/LocalRootStorage.php +++ b/lib/private/Files/Storage/LocalRootStorage.php @@ -17,6 +17,7 @@ class LocalRootStorage extends Local { if (!$storage) { $storage = $this; } + /** @var Local $storage */ return $storage->scanner ?? ($storage->scanner = new LocalRootScanner($storage)); } } diff --git a/lib/private/Files/Storage/Wrapper/Encoding.php b/lib/private/Files/Storage/Wrapper/Encoding.php index 92e20cfb3df..3e98be8e553 100644 --- a/lib/private/Files/Storage/Wrapper/Encoding.php +++ b/lib/private/Files/Storage/Wrapper/Encoding.php @@ -11,7 +11,6 @@ use OC\Files\Filesystem; use OCP\Cache\CappedMemoryCache; use OCP\Files\Cache\IScanner; use OCP\Files\Storage\IStorage; -use OCP\ICache; /** * Encoding wrapper that deals with file names that use unsupported encodings like NFD. @@ -20,10 +19,7 @@ use OCP\ICache; * the actual given name and then try its NFD form. */ class Encoding extends Wrapper { - /** - * @var ICache - */ - private $namesCache; + private CappedMemoryCache $namesCache; /** * @param array $parameters