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 46366d6715
7 changed files with 15 additions and 13 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

@ -81,12 +81,13 @@ trait TimelineWriteOrphans
protected function getSomeOrphans(int $count, array $fields): array
{
$query = $this->connection->getQueryBuilder();
$query->select(...$fields)
return $query->select(...$fields)
->from('memories')
->where($query->expr()->eq('orphan', $query->expr()->literal(1)))
->setMaxResults($count)
->executeQuery()
->fetchAll()
;
return $query->executeQuery()->fetchAll();
}
}

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" />