diff --git a/src/Command/GenerateBackupCodesCommand.php b/src/Command/GenerateBackupCodesCommand.php index 3b73cda..a454622 100644 --- a/src/Command/GenerateBackupCodesCommand.php +++ b/src/Command/GenerateBackupCodesCommand.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Command; use App\PersistCache; -use App\Service\BackupCodeManager; +use App\Service\BackupCodeInterface; use Psr\Cache\InvalidArgumentException; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; @@ -15,8 +15,8 @@ use Symfony\Component\Console\Output\OutputInterface; * usage: php bin/console app:generate-backup-codes [count] */ final class GenerateBackupCodesCommand extends Command { public function __construct( - private readonly BackupCodeManager $manager, - private readonly PersistCache $persistCache, + private readonly BackupCodeInterface $manager, + private readonly PersistCache $persistCache, ) { parent::__construct(); } diff --git a/src/Listener/AcceptListener.php b/src/Listener/AcceptListener.php index 389e842..1e424f4 100644 --- a/src/Listener/AcceptListener.php +++ b/src/Listener/AcceptListener.php @@ -3,7 +3,7 @@ declare(strict_types=1); namespace App\Listener; -use App\Service\DomainManager; +use App\Service\DomainInterface; use App\Trait\CookieNameTrait; use App\Trait\HasLoggerTrait; use App\Trait\StringTrait; @@ -20,7 +20,7 @@ final readonly class AcceptListener { public function __construct( private CacheItemPoolInterface $sessionCache, - private DomainManager $domainManager, + private DomainInterface $domainManager, ) {} /** @throws InvalidArgumentException */ diff --git a/src/Listener/InterceptListener.php b/src/Listener/InterceptListener.php index 33506b7..7fdc936 100644 --- a/src/Listener/InterceptListener.php +++ b/src/Listener/InterceptListener.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Listener; use App\ConfigBag; -use App\Service\DomainManager; +use App\Service\DomainInterface; use App\Trait\CookieNameTrait; use App\Trait\HasLoggerTrait; use App\Trait\MakeNonceTrait; @@ -24,9 +24,9 @@ final readonly class InterceptListener { use MakeNonceTrait; public function __construct( - private ConfigBag $config, - private DomainManager $domainManager, - private Environment $twig, + private ConfigBag $config, + private DomainInterface $domainManager, + private Environment $twig, ) {} /** @throws InvalidArgumentException|RuntimeError|SyntaxError|LoaderError */ diff --git a/src/Listener/LoginListener.php b/src/Listener/LoginListener.php index cc3095e..1c8ca69 100644 --- a/src/Listener/LoginListener.php +++ b/src/Listener/LoginListener.php @@ -5,8 +5,8 @@ namespace App\Listener; use App\ConfigBag; use App\Data\Payload; -use App\Service\DomainManager; -use App\Service\LoginManager; +use App\Service\DomainInterface; +use App\Service\LoginInterface; use App\Trait\CookieNameTrait; use App\Trait\HasLoggerTrait; use App\Trait\MakeNonceTrait; @@ -34,8 +34,8 @@ final readonly class LoginListener { public function __construct( private Environment $twig, #[Target('login_limiter')] RateLimiterFactoryInterface $rateLimiter, - private DomainManager $domainManager, - private LoginManager $loginManager, + private DomainInterface $domainManager, + private LoginInterface $loginManager, private ConfigBag $config, ) { $this->rateLimiter = $rateLimiter; diff --git a/src/Service/BackupCodeInterface.php b/src/Service/BackupCodeInterface.php new file mode 100644 index 0000000..9c13709 --- /dev/null +++ b/src/Service/BackupCodeInterface.php @@ -0,0 +1,26 @@ + ['com','net','off','org'], diff --git a/src/Service/LoginInterface.php b/src/Service/LoginInterface.php new file mode 100644 index 0000000..98b58cb --- /dev/null +++ b/src/Service/LoginInterface.php @@ -0,0 +1,13 @@ +sessionCache = new MonitorCacheKeys($sessionCache); }