psalm: refactor suppressions

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/888/head
Varun Patil 2023-10-22 13:56:27 -07:00
parent c9e87c4cf6
commit 07b0e7070e
6 changed files with 11 additions and 10 deletions

View File

@ -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(

View File

@ -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

View File

@ -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)

View File

@ -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;
}

View File

@ -43,6 +43,11 @@
<file name="lib/Service/FileRobotMagick.php" />
</errorLevel>
</PossiblyUnusedMethod>
<PropertyNotSetInConstructor>
<errorLevel type="suppress">
<directory name="lib/Command" />
</errorLevel>
</PropertyNotSetInConstructor>
</issueHandlers>
<forbiddenFunctions>
<function name="var_dump" />

View File

@ -42,6 +42,11 @@
<file name="lib/Service/FileRobotMagick.php" />
</errorLevel>
</PossiblyUnusedMethod>
<PropertyNotSetInConstructor>
<errorLevel type="suppress">
<directory name="lib/Command" />
</errorLevel>
</PropertyNotSetInConstructor>
</issueHandlers>
<forbiddenFunctions>
<function name="var_dump" />