MAPG-199 fix issues found by PHPStan

This commit is contained in:
bence committed 2020-07-05 23:18:56 +02:00
1 parent 39d691fd7f
commit af98d71924
34 files changed
+89 -68

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ use Symfony\Component\Console\Output\OutputInterface;
class AddUserCommand extends Command
{
public function configure()
public function configure(): void
{
$this->setName('user:add')
->setDescription('Adding of user.')
+1 -1
View File
@@ -11,7 +11,7 @@ use Symfony\Component\Console\Output\OutputInterface;
class LinkViewCommand extends Command
{
public function configure()
public function configure(): void
{
$this->setName('view:link')
->setDescription('Linking of views.')
+5 -5
View File
@@ -14,7 +14,7 @@ use Symfony\Component\Console\Output\OutputInterface;
class MaintainDatabaseCommand extends Command
{
private PersistentDataManager $persistentDataManager;
private PersistentDataManager $pdm;
private UserRepository $userRepository;
@@ -26,13 +26,13 @@ class MaintainDatabaseCommand extends Command
{
parent::__construct();
$this->persistentDataManager = new PersistentDataManager();
$this->pdm = new PersistentDataManager();
$this->userRepository = new UserRepository();
$this->userConfirmationRepository = new UserConfirmationRepository();
$this->userPasswordResetterRepository = new UserPasswordResetterRepository();
}
public function configure()
public function configure(): void
{
$this->setName('db:maintain')
->setDescription('Maintain database.');
@@ -76,7 +76,7 @@ class MaintainDatabaseCommand extends Command
$this->pdm->deleteFromDb($userPasswordResetter);
}
$this->persistentDataManager->deleteFromDb($user);
$this->pdm->deleteFromDb($user);
}
\Container::$dbConnection->commit();
@@ -85,7 +85,7 @@ class MaintainDatabaseCommand extends Command
private function deleteExpiredPasswordResetters(): void
{
foreach ($this->userPasswordResetterRepository->getAllExpired() as $passwordResetter) {
$this->persistentDataManager->deleteFromDb($passwordResetter);
$this->pdm->deleteFromDb($passwordResetter);
}
}
+5 -1
View File
@@ -9,7 +9,7 @@ use Symfony\Component\Console\Output\OutputInterface;
class MigrateDatabaseCommand extends Command
{
public function configure()
public function configure(): void
{
$this->setName('db:migrate')
->setDescription('Migration of database changes.');
@@ -88,6 +88,10 @@ class MigrateDatabaseCommand extends Command
$path = ROOT . '/database/migrations/' . $type;
$dir = opendir($path);
if ($dir === false) {
throw new \Exception('Cannot open dir: ' . $path);
}
$files = [];
while ($file = readdir($dir)) {
$filePath = $path . '/' . $file;