From 07b0e7070e82c8a5053aac819bb21eecb604881d Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sun, 22 Oct 2023 13:56:27 -0700 Subject: [PATCH] psalm: refactor suppressions Signed-off-by: Varun Patil --- lib/Command/Index.php | 5 ----- lib/Command/MigrateGoogleTakeout.php | 3 --- lib/Command/PlacesSetup.php | 1 - lib/Db/AlbumsQuery.php | 2 +- psalm-ls.xml | 5 +++++ psalm.xml | 5 +++++ 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/Command/Index.php b/lib/Command/Index.php index d9d71399..84e2d585 100644 --- a/lib/Command/Index.php +++ b/lib/Command/Index.php @@ -57,13 +57,8 @@ class IndexOpts class Index extends Command { - /** @psalm-suppress PropertyNotSetInConstructor */ private InputInterface $input; - - /** @psalm-suppress PropertyNotSetInConstructor */ private OutputInterface $output; - - /** @psalm-suppress PropertyNotSetInConstructor */ private IndexOpts $opts; public function __construct( diff --git a/lib/Command/MigrateGoogleTakeout.php b/lib/Command/MigrateGoogleTakeout.php index 775ace21..7d1116df 100644 --- a/lib/Command/MigrateGoogleTakeout.php +++ b/lib/Command/MigrateGoogleTakeout.php @@ -44,10 +44,7 @@ class MigrateGoogleTakeout extends Command protected const MIGRATOR_VERSION = 1; protected const MIGRATED_KEY = 'memoriesMigratorVersion'; - /** @psalm-suppress PropertyNotSetInConstructor */ protected OutputInterface $output; - - /** @psalm-suppress PropertyNotSetInConstructor */ protected InputInterface $input; // Stats diff --git a/lib/Command/PlacesSetup.php b/lib/Command/PlacesSetup.php index af36744f..82446522 100644 --- a/lib/Command/PlacesSetup.php +++ b/lib/Command/PlacesSetup.php @@ -31,7 +31,6 @@ use Symfony\Component\Console\Output\OutputInterface; class PlacesSetup extends Command { - /** @psalm-suppress PropertyNotSetInConstructor */ protected OutputInterface $output; public function __construct(protected Places $places) diff --git a/lib/Db/AlbumsQuery.php b/lib/Db/AlbumsQuery.php index e3dbbd8f..46eaff7d 100644 --- a/lib/Db/AlbumsQuery.php +++ b/lib/Db/AlbumsQuery.php @@ -149,6 +149,7 @@ class AlbumsQuery public function getIfAllowed(string $uid, string $albumId): ?array { $album = null; + $albumUid = null; // Split name and uid $parts = explode('/', $albumId); @@ -173,7 +174,6 @@ class AlbumsQuery } // Check if user is owner - /** @psalm-suppress PossiblyUndefinedVariable */ if ($albumUid === $uid) { return $album; } diff --git a/psalm-ls.xml b/psalm-ls.xml index 216d01a8..f4ccb982 100644 --- a/psalm-ls.xml +++ b/psalm-ls.xml @@ -43,6 +43,11 @@ + + + + + diff --git a/psalm.xml b/psalm.xml index 94678da0..f18a981f 100644 --- a/psalm.xml +++ b/psalm.xml @@ -42,6 +42,11 @@ + + + + +