adapt Container usage to new soko-web
rvr-nextgen/pipeline/pr-master This commit looks good

This commit is contained in:
bence committed 2023-04-19 23:38:43 +02:00
1 parent 36f767ea9b
commit dccb34971b
20 files changed
+135 -237

No files matched your search

+1 -3
View File
@@ -1,7 +1,6 @@
<?php namespace RVR\Cli;
use DateTime;
use SokoWeb\PersistentData\PersistentDataManager;
use RVR\PersistentData\Model\OAuthClient;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@@ -33,8 +32,7 @@ class AddOAuthClientCommand extends Command
}
try {
$pdm = new PersistentDataManager();
$pdm->saveToDb($oAuthClient);
\Container::$persistentDataManager->saveToDb($oAuthClient);
} catch (\Exception $e) {
$output->writeln('<error>Adding OAuth client failed!</error>');
$output->writeln('');
+1 -3
View File
@@ -1,6 +1,5 @@
<?php namespace RVR\Cli;
use SokoWeb\PersistentData\PersistentDataManager;
use RVR\Repository\OAuthClientRepository;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@@ -32,8 +31,7 @@ class AddOAuthRedirectUriCommand extends Command
$oAuthClient->setRedirectUrisArray($redirectUris);
try {
$pdm = new PersistentDataManager();
$pdm->saveToDb($oAuthClient);
\Container::$persistentDataManager->saveToDb($oAuthClient);
} catch (\Exception $e) {
$output->writeln('<error>Adding redirect URI failed!</error>');
$output->writeln('');
+1 -3
View File
@@ -1,7 +1,6 @@
<?php namespace RVR\Cli;
use DateTime;
use SokoWeb\PersistentData\PersistentDataManager;
use RVR\PersistentData\Model\User;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@@ -36,8 +35,7 @@ class AddUserCommand extends Command
}
try {
$pdm = new PersistentDataManager();
$pdm->saveToDb($user);
\Container::$persistentDataManager->saveToDb($user);
} catch (\Exception $e) {
$output->writeln('<error>Adding user failed!</error>');
$output->writeln('');
+1 -5
View File
@@ -4,7 +4,6 @@ use DateTime;
use SokoWeb\Database\Query\Modify;
use SokoWeb\Database\Query\Select;
use SokoWeb\Interfaces\Database\IResultSet;
use SokoWeb\PersistentData\PersistentDataManager;
use RVR\Repository\UserPasswordResetterRepository;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
@@ -12,15 +11,12 @@ use Symfony\Component\Console\Output\OutputInterface;
class MaintainDatabaseCommand extends Command
{
private PersistentDataManager $pdm;
private UserPasswordResetterRepository $userPasswordResetterRepository;
public function __construct()
{
parent::__construct();
$this->pdm = new PersistentDataManager();
$this->userPasswordResetterRepository = new UserPasswordResetterRepository();
}
@@ -54,7 +50,7 @@ class MaintainDatabaseCommand extends Command
private function deleteExpiredPasswordResetters(): void
{
foreach ($this->userPasswordResetterRepository->getAllExpired() as $passwordResetter) {
$this->pdm->deleteFromDb($passwordResetter);
\Container::$persistentDataManager->deleteFromDb($passwordResetter);
}
}
+1 -3
View File
@@ -1,6 +1,5 @@
<?php namespace RVR\Cli;
use SokoWeb\PersistentData\PersistentDataManager;
use RVR\Repository\OAuthClientRepository;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@@ -32,8 +31,7 @@ class RemoveOAuthRedirectUriCommand extends Command
$oAuthClient->setRedirectUrisArray($redirectUris);
try {
$pdm = new PersistentDataManager();
$pdm->saveToDb($oAuthClient);
\Container::$persistentDataManager->saveToDb($oAuthClient);
} catch (\Exception $e) {
$output->writeln('<error>Removing redirect URI failed!</error>');
$output->writeln('');