Use typed properties

This commit is contained in:
Jan Böhmer 2022-09-18 22:59:31 +02:00
parent 548ec2ea50
commit 51e05a8669
216 changed files with 603 additions and 698 deletions

View file

@ -46,6 +46,7 @@ use App\Entity\LogSystem\UserLoginLogEntry;
use App\Entity\UserSystem\User;
use App\Services\LogSystem\EventLogger;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
@ -57,10 +58,10 @@ use Symfony\Contracts\Translation\TranslatorInterface;
*/
final class LoginSuccessSubscriber implements EventSubscriberInterface
{
private $translator;
private $flashBag;
private $eventLogger;
private $gpdr_compliance;
private TranslatorInterface $translator;
private FlashBagInterface $flashBag;
private EventLogger $eventLogger;
private bool $gpdr_compliance;
public function __construct(TranslatorInterface $translator, SessionInterface $session, EventLogger $eventLogger, bool $gpdr_compliance)
{

View file

@ -56,8 +56,8 @@ use Symfony\Component\Security\Core\Security;
*/
final class LogoutDisabledUserSubscriber implements EventSubscriberInterface
{
private $security;
private $urlGenerator;
private Security $security;
private UrlGeneratorInterface $urlGenerator;
public function __construct(Security $security, UrlGeneratorInterface $urlGenerator)
{

View file

@ -44,6 +44,7 @@ namespace App\EventSubscriber\UserSystem;
use App\Entity\UserSystem\User;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Event\RequestEvent;
@ -74,9 +75,9 @@ final class PasswordChangeNeededSubscriber implements EventSubscriberInterface
* @var string The route the user will redirected to, if he needs to change this password
*/
public const REDIRECT_TARGET = 'user_settings';
private $security;
private $flashBag;
private $httpUtils;
private Security $security;
private FlashBagInterface $flashBag;
private HttpUtils $httpUtils;
public function __construct(Security $security, SessionInterface $session, HttpUtils $httpUtils)
{

View file

@ -51,6 +51,7 @@ use R\U2FTwoFactorBundle\Event\RegisterEvent;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
@ -61,19 +62,16 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
*/
final class RegisterU2FSubscriber implements EventSubscriberInterface
{
private $em;
private EntityManagerInterface $em;
private $demo_mode;
private $flashBag;
/**
* @var UrlGeneratorInterface
*/
private $router;
private bool $demo_mode;
private FlashBagInterface $flashBag;
private UrlGeneratorInterface $router;
/**
* @var EventDispatcher|EventDispatcherInterface
* @var EventDispatcher
*/
private $eventDispatcher;
private EventDispatcherInterface $eventDispatcher;
public function __construct(UrlGeneratorInterface $router, EntityManagerInterface $entityManager, SessionInterface $session, EventDispatcherInterface $eventDispatcher, bool $demo_mode)
{

View file

@ -53,8 +53,8 @@ use Symfony\Component\Security\Core\Security;
*/
final class SetUserTimezoneSubscriber implements EventSubscriberInterface
{
private $default_timezone;
private $security;
private string $default_timezone;
private Security $security;
public function __construct(string $timezone, Security $security)
{