Skip to content

Commit 44a6d77

Browse files
committed
[Security] Add types to private properties
Signed-off-by: Alexander M. Turek <me@derrabus.de>
1 parent cb696c8 commit 44a6d77

File tree

67 files changed

+206
-215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+206
-215
lines changed

AccessMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
class AccessMap implements AccessMapInterface
2424
{
25-
private $map = [];
25+
private array $map = [];
2626

2727
/**
2828
* @param array $attributes An array of attributes to pass to the access decision manager (like roles)

Authentication/AuthenticationUtils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
class AuthenticationUtils
2525
{
26-
private $requestStack;
26+
private RequestStack $requestStack;
2727

2828
public function __construct(RequestStack $requestStack)
2929
{

Authentication/AuthenticatorManager.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@
4545
*/
4646
class AuthenticatorManager implements AuthenticatorManagerInterface, UserAuthenticatorInterface
4747
{
48-
private $authenticators;
49-
private $tokenStorage;
50-
private $eventDispatcher;
51-
private $eraseCredentials;
52-
private $logger;
53-
private $firewallName;
54-
private $hideUserNotFoundExceptions;
55-
private $requiredBadges;
48+
private iterable $authenticators;
49+
private TokenStorageInterface $tokenStorage;
50+
private EventDispatcherInterface $eventDispatcher;
51+
private bool $eraseCredentials;
52+
private ?LoggerInterface $logger;
53+
private string $firewallName;
54+
private bool $hideUserNotFoundExceptions;
55+
private array $requiredBadges;
5656

5757
/**
58-
* @param AuthenticatorInterface[] $authenticators
58+
* @param iterable<mixed, AuthenticatorInterface> $authenticators
5959
*/
6060
public function __construct(iterable $authenticators, TokenStorageInterface $tokenStorage, EventDispatcherInterface $eventDispatcher, string $firewallName, LoggerInterface $logger = null, bool $eraseCredentials = true, bool $hideUserNotFoundExceptions = true, array $requiredBadges = [])
6161
{

Authentication/CustomAuthenticationFailureHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class CustomAuthenticationFailureHandler implements AuthenticationFailureHandlerInterface
2222
{
23-
private $handler;
23+
private AuthenticationFailureHandlerInterface $handler;
2424

2525
/**
2626
* @param array $options Options for processing a successful authentication attempt

Authentication/CustomAuthenticationSuccessHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class CustomAuthenticationSuccessHandler implements AuthenticationSuccessHandlerInterface
2222
{
23-
private $handler;
23+
private AuthenticationSuccessHandlerInterface $handler;
2424

2525
/**
2626
* @param array $options Options for processing a successful authentication attempt

Authenticator/AbstractPreAuthenticatedAuthenticator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
*/
3737
abstract class AbstractPreAuthenticatedAuthenticator implements InteractiveAuthenticatorInterface
3838
{
39-
private $userProvider;
40-
private $tokenStorage;
41-
private $firewallName;
42-
private $logger;
39+
private UserProviderInterface $userProvider;
40+
private TokenStorageInterface $tokenStorage;
41+
private string $firewallName;
42+
private ?LoggerInterface $logger;
4343

4444
public function __construct(UserProviderInterface $userProvider, TokenStorageInterface $tokenStorage, string $firewallName, LoggerInterface $logger = null)
4545
{

Authenticator/Debug/TraceableAuthenticator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
*/
3030
final class TraceableAuthenticator implements AuthenticatorInterface, InteractiveAuthenticatorInterface, AuthenticationEntryPointInterface
3131
{
32-
private $authenticator;
33-
private $passport;
34-
private $duration;
35-
private $stub;
32+
private AuthenticatorInterface $authenticator;
33+
private ?Passport $passport = null;
34+
private ?float $duration = null;
35+
private ClassStub|string $stub;
3636

3737
public function __construct(AuthenticatorInterface $authenticator)
3838
{

Authenticator/Debug/TraceableAuthenticatorManagerListener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
*/
2525
final class TraceableAuthenticatorManagerListener extends AbstractListener
2626
{
27-
private $authenticationManagerListener;
28-
private $authenticatorsInfo = [];
29-
private $hasVardumper;
27+
private AuthenticatorManagerListener $authenticationManagerListener;
28+
private array $authenticatorsInfo = [];
29+
private bool $hasVardumper;
3030

3131
public function __construct(AuthenticatorManagerListener $authenticationManagerListener)
3232
{

Authenticator/FormLoginAuthenticator.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@
4141
*/
4242
class FormLoginAuthenticator extends AbstractLoginFormAuthenticator
4343
{
44-
private $httpUtils;
45-
private $userProvider;
46-
private $successHandler;
47-
private $failureHandler;
48-
private $options;
49-
private $httpKernel;
44+
private HttpUtils $httpUtils;
45+
private UserProviderInterface $userProvider;
46+
private AuthenticationSuccessHandlerInterface $successHandler;
47+
private AuthenticationFailureHandlerInterface $failureHandler;
48+
private array $options;
49+
private HttpKernelInterface $httpKernel;
5050

5151
public function __construct(HttpUtils $httpUtils, UserProviderInterface $userProvider, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, array $options)
5252
{

Authenticator/HttpBasicAuthenticator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
*/
3434
class HttpBasicAuthenticator implements AuthenticatorInterface, AuthenticationEntryPointInterface
3535
{
36-
private $realmName;
37-
private $userProvider;
38-
private $logger;
36+
private string $realmName;
37+
private UserProviderInterface $userProvider;
38+
private ?LoggerInterface $logger;
3939

4040
public function __construct(string $realmName, UserProviderInterface $userProvider, LoggerInterface $logger = null)
4141
{

0 commit comments

Comments
 (0)