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

@ -90,14 +90,14 @@ class EventLoggerSubscriber implements EventSubscriber
protected const MAX_STRING_LENGTH = 2000;
protected $logger;
protected $serializer;
protected $eventCommentHelper;
protected $eventUndoHelper;
protected $save_changed_fields;
protected $save_changed_data;
protected $save_removed_data;
protected $propertyAccessor;
protected EventLogger $logger;
protected SerializerInterface $serializer;
protected EventCommentHelper $eventCommentHelper;
protected EventUndoHelper $eventUndoHelper;
protected bool $save_changed_fields;
protected bool $save_changed_data;
protected bool $save_removed_data;
protected PropertyAccessorInterface $propertyAccessor;
public function __construct(EventLogger $logger, SerializerInterface $serializer, EventCommentHelper $commentHelper,
bool $save_changed_fields, bool $save_changed_data, bool $save_removed_data, PropertyAccessorInterface $propertyAccessor,

View file

@ -35,7 +35,7 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException;
*/
class LogAccessDeniedSubscriber implements EventSubscriberInterface
{
private $logger;
private EventLogger $logger;
public function __construct(EventLogger $logger)
{

View file

@ -54,11 +54,11 @@ use Doctrine\Migrations\Events;
*/
class LogDBMigrationSubscriber implements EventSubscriber
{
protected $old_version = null;
protected $new_version = null;
protected ?string $old_version = null;
protected ?string $new_version = null;
protected $eventLogger;
protected $dependencyFactory;
protected EventLogger $eventLogger;
protected DependencyFactory $dependencyFactory;
public function __construct(EventLogger $eventLogger, DependencyFactory $dependencyFactory)
{

View file

@ -52,8 +52,8 @@ use Symfony\Component\Security\Http\Event\LogoutEvent;
*/
class LogoutLoggerListener
{
protected $logger;
protected $gpdr_compliance;
protected EventLogger $logger;
protected bool $gpdr_compliance;
public function __construct(EventLogger $logger, bool $gpdr_compliance)
{

View file

@ -35,9 +35,9 @@ use Symfony\Component\HttpFoundation\RequestStack;
*/
final class SecurityEventLoggerSubscriber implements EventSubscriberInterface
{
private $requestStack;
private $gpdr_compliant;
private $eventLogger;
private RequestStack $requestStack;
private bool $gpdr_compliant;
private EventLogger $eventLogger;
public function __construct(RequestStack $requestStack, EventLogger $eventLogger, bool $gpdr_compliance)
{

View file

@ -52,8 +52,8 @@ use Symfony\Component\Mime\Email;
*/
final class SetMailFromSubscriber implements EventSubscriberInterface
{
private $email;
private $name;
private string $email;
private string $name;
public function __construct(string $email, string $name)
{

View file

@ -50,7 +50,7 @@ use Symfony\Component\HttpKernel\Event\ResponseEvent;
*/
final class SymfonyDebugToolbarSubscriber implements EventSubscriberInterface
{
private $kernel_debug;
private bool $kernel_debug;
public function __construct(bool $kernel_debug)
{

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)
{