8000 added type-hint · symfony/symfony@57c0388 · GitHub
[go: up one dir, main page]

Skip to content

Commit 57c0388

Browse files
committed
added type-hint
1 parent 91d01d8 commit 57c0388

19 files changed

+60
-159
lines changed

src/Symfony/Bridge/Twig/Extension/SecurityExtension.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bridge\Twig\Extension;
1313

1414
use Symfony\Component\Security\Acl\Voter\FieldVote;
15-
use Symfony\Component\Security\Core\SecurityContextInterface;
1615
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
1716

1817
/**
@@ -24,12 +23,7 @@ class SecurityExtension extends \Twig_Extension
2423
{
2524
private $securityChecker;
2625

27-
/**
28-
* @param SecurityContextInterface|AuthorizationCheckerInterface
29-
*
30-
* Passing a SecurityContextInterface as a first argument was deprecated in 2.7 and will be removed in 3.0
31-
*/
32-
public function __construct($securityChecker = null)
26+
public function __construct(AuthorizationCheckerInterface $securityChecker = null)
3327
{
3428
$this->securityChecker = $securityChecker;
3529
}

src/Symfony/Bundle/SecurityBundle/Templating/Helper/SecurityHelper.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\Security\Acl\Voter\FieldVote;
1515
use Symfony\Component\Templating\Helper\Helper;
16-
use Symfony\Component\Security\Core\SecurityContextInterface;
1716
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
1817

1918
/**
@@ -25,12 +24,7 @@ class SecurityHelper extends Helper
2524
{
2625
private $securityChecker;
2726

28-
/**
29-
* @param SecurityContextInterface|AuthorizationCheckerInterface
30-
*
31-
* Passing a SecurityContextInterface as a first argument was deprecated in 2.7 and will be removed in 3.0
32-
*/
33-
public function __construct($securityChecker = null)
27+
public function __construct(AuthorizationCheckerInterface $securityChecker = null)
3428
{
3529
$this->securityChecker = $securityChecker;
3630
}

src/Symfony/Component/Security/Core/Validator/Constraints/UserPasswordValidator.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Security\Core\Validator\Constraints;
1313

1414
use Symfony\Component\Security\Core\User\UserInterface;
15-
use Symfony\Component\Security\Core\SecurityContextInterface;
1615
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
1716
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
1817
use Symfony\Component\Validator\Constraint;
@@ -25,12 +24,7 @@ class UserPasswordValidator extends ConstraintValidator
2524
private $tokenStorage;
2625
private $encoderFactory;
2726

28-
/**
29-
* @param SecurityContextInterface|TokenStorageInterface
30-
*
31-
* Passing a SecurityContextInterface as a first argument was deprecated in 2.7 and will be removed in 3.0
32-
*/
33-
public function __construct($tokenStorage, EncoderFactoryInterface $encoderFactory)
27+
public function __construct(TokenStorageInterface $tokenStorage, EncoderFactoryInterface $encoderFactory)
3428
{
3529
$this->tokenStorage = $tokenStorage;
3630
$this->encoderFactory = $encoderFactory;

src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
1717
use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface;
1818
use Symfony\Component\Security\Core\Security;
19-
use Symfony\Component\Security\Core\SecurityContextInterface;
2019
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
2120
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
2221
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
@@ -67,23 +66,21 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
6766
/**
6867
* Constructor.
6968
*
70-
* @param SecurityContextInterface|TokenStorageInterface $tokenStorage A SecurityContext or a TokenStorageInterface instance
71-
* @param AuthenticationManagerInterface $authenticationManager An AuthenticationManagerInterface instance
72-
* @param SessionAuthenticationStrategyInterface $sessionStrategy
73-
* @param HttpUtils $httpUtils An HttpUtilsInterface instance
74-
* @param string $providerKey
75-
* @param AuthenticationSuccessHandlerInterface $successHandler
76-
* @param AuthenticationFailureHandlerInterface $failureHandler
77-
* @param array $options An array of options for the processing of a
78-
* successful, or failed authentication attempt
79-
* @param LoggerInterface $logger A LoggerInterface instance
80-
* @param EventDispatcherInterface $dispatcher An EventDispatcherInterface instance
69+
* @param TokenStorageInterface $tokenStorage A TokenStorageInterface instance
70+
* @param AuthenticationManagerInterface $authenticationManager An AuthenticationManagerInterface instance
71+
* @param SessionAuthenticationStrategyInterface $sessionStrategy
72+
* @param HttpUtils $httpUtils An HttpUtilsInterface instance
73+
* @param string $providerKey
74+
* @param AuthenticationSuccessHandlerInterface $successHandler
75+
* @param AuthenticationFailureHandlerInterface $failureHandler
76+
* @param array $options An array of options for the processing of a
77+
* successful, or failed authentication attempt
78+
* @param LoggerInterface $logger A LoggerInterface instance
79+
* @param EventDispatcherInterface $dispatcher An EventDispatcherInterface instance
8180
*
8281
* @throws \InvalidArgumentException
83-
*
84-
* Passing a SecurityContextInterface as a first argument was deprecated in 2.7 and will be removed in 3.0
8582
*/
86-
public function __construct($tokenStorage, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, HttpUtils $httpUtils, $providerKey, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, array $options = array(), LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
83+
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, HttpUtils $httpUtils, $providerKey, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, array $options = array(), LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
8784
{
8885
if (empty($providerKey)) {
8986
throw new \InvalidArgumentException('$providerKey must not be empty.');

src/Symfony/Component/Security/Http/Firewall/AbstractPreAuthenticatedListener.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Security\Http\Firewall;
1313

14-
use Symfony\Component\Security\Core\SecurityContextInterface;
1514
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
1615
use Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken;
1716
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
@@ -39,12 +38,7 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface
3938
private $providerKey;
4039
private $dispatcher;
4140

42-
/**
43-
* @param SecurityContextInterface|TokenStorageInterface
44-
*
45-
* Passing a SecurityContextInterface as a first argument was deprecated in 2.7 and will be removed in 3.0
46-
*/
47-
public function __construct($tokenStorage, AuthenticationManagerInterface $authenticationManager, $providerKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
41+
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, $providerKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
4842
{
4943
$this->tokenStorage = $tokenStorage;
5044
$this->authenticationManager = $authenticationManager;

src/Symfony/Component/Security/Http/Firewall/AccessListener.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Security\Http\Firewall;
1313

14-
use Symfony\Component\Security\Core\SecurityContextInterface;
1514
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
1615
use Symfony\Component\Security\Http\AccessMapInterface;
1716
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
@@ -32,12 +31,7 @@ class AccessListener implements ListenerInterface
3231
private $map;
3332
private $authManager;
3433

35-
/**
36-
* @param SecurityContextInterface|TokenStorageInterface
37-
*
38-
* Passing a SecurityContextInterface as a first argument was deprecated in 2.7 and will be removed in 3.0
39-
*/
40-
public function __construct($tokenStorage, AccessDecisionManagerInterface $accessDecisionManager, AccessMapInterface $map, AuthenticationManagerInterface $authManager)
34+
public function __construct(TokenStorageInterface $tokenStorage, AccessDecisionManagerInterface $accessDecisionManager, AccessMapInterface $map, AuthenticationManagerInterface $authManager)
4135
{
4236
$this->tokenStorage = $tokenStorage;
4337
$this->accessDecisionManager = $accessDecisionManager;

src/Symfony/Component/Security/Http/Firewall/AnonymousAuthenticationListener.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
1515
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
1616
use Symfony\Component\Security\Core\Exception\AuthenticationException;
17-
use Symfony\Component\Security\Core\SecurityContextInterface;
1817
use Psr\Log\LoggerInterface;
1918
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
2019
use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
@@ -32,12 +31,7 @@ class AnonymousAuthenticationListener implements ListenerInterface
3231
private $authenticationManager;
3332
private $logger;
3433

35-
/**
36-
* @param SecurityContextInterface|TokenStorageInterface
37-
*
38-
* Passing a SecurityContextInterface as a first argument was deprecated in 2.7 and will be removed in 3.0
39-
*/
40-
public function __construct($tokenStorage, $key, LoggerInterface $logger = null, AuthenticationManagerInterface $authenticationManager = null)
34+
public function __construct(TokenStorageInterface $tokenStorage, $key, LoggerInterface $logger = null, AuthenticationManagerInterface $authenticationManager = null)
4135
{
4236
$this->tokenStorage = $tokenStorage;
4337
$this->key = $key;

src/Symfony/Component/Security/Http/Firewall/BasicAuthenticationListener.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Security\Http\Firewall;
1313

14-
use Symfony\Component\Security\Core\SecurityContextInterface;
1514
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
1615
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
1716
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
@@ -34,12 +33,7 @@ class BasicAuthenticationListener implements ListenerInterface
3433
private $logger;
3534
private $ignoreFailure;
3635

37-
/**
38-
* @param SecurityContextInterface|TokenStorageInterface
39-
*
40-
* Passing a SecurityContextInterface as a first argument was deprecated in 2.7 and will be removed in 3.0
41-
*/
42-
public function __construct($tokenStorage, AuthenticationManagerInterface $authenticationManager, $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint, LoggerInterface $logger = null)
36+
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint, LoggerInterface $logger = null)
4337
{
4438
if (empty($providerKey)) {
4539
throw new \InvalidArgumentException('$providerKey must not be empty.');

src/Symfony/Component/Security/Http/Firewall/ContextListener.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
2121
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
2222
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
23-
use Symfony\Component\Security\Core\SecurityContextInterface;
2423
use Symfony\Component\Security\Core\User\UserInterface;
2524
use Symfony\Component\Security\Core\User\UserProviderInterface;
2625
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -40,12 +39,7 @@ class ContextListener implements ListenerInterface
4039
private $dispatcher;
4140
private $registered;
4241

43-
/**
44-
* @param SecurityContextInterface|TokenStorageInterface
45-
*
46-
* Passing a SecurityContextInterface as a first argument was deprecated in 2.7 and will be removed in 3.0
47-
*/
48-
public function __construct($tokenStorage, array $userProviders, $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
42+
public function __construct(TokenStorageInterface $tokenStorage, array $userProviders, $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
4943
{
5044
if (empty($contextKey)) {
5145
throw new \InvalidArgumentException('$contextKey must not be empty.');

src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Security\Http\Firewall;
1313

14-
use Symfony\Component\Security\Core\SecurityContextInterface;
1514
use Symfony\Component\Security\Core\User\UserProviderInterface;
1615
use Symfony\Component\Security\Http\EntryPoint\DigestAuthenticationEntryPoint;
1716
use Psr\Log\LoggerInterface;
@@ -38,12 +37,7 @@ class DigestAuthenticationListener implements ListenerInterface
3837
private $authenticationEntryPoint;
3938
private $logger;
4039

41-
/**
42-
* @param SecurityContextInterface|TokenStorageInterface
43-
*
44-
* Passing a SecurityContextInterface as a first argument was deprecated in 2.7 and will be removed in 3.0
45-
*/
46-
public function __construct($tokenStorage, UserProviderInterface $provider, $providerKey, DigestAuthenticationEntryPoint $authenticationEntryPoint, LoggerInterface $logger = null)
40+
public function __construct(TokenStorageInterface $tokenStorage, UserProviderInterface $provider, $providerKey, DigestAuthenticationEntryPoint $authenticationEntryPoint, LoggerInterface $logger = null)
4741
{
4842
if (empty($providerKey)) {
4943
throw new \InvalidArgumentException('$providerKey must not be empty.');

src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\HttpFoundation\Response;
1515
use Symfony\Component\Security\Http\Authorization\AccessDeniedHandlerInterface;
1616
use Symfony\Component\Security\Core\Security;
17-
use Symfony\Component\Security\Core\SecurityContextInterface;
1817
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
1918
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
2019
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
@@ -49,12 +48,7 @@ class ExceptionListener
4948
private $logger;
5049
private $httpUtils;
5150

52-
/**
53-
* @param SecurityContextInterface|TokenStorageInterface
54-
*
55-
* Passing a SecurityContextInterface as a first argument was deprecated in 2.7 and will be removed in 3.0
56-
*/
57-
public function __construct($tokenStorage, AuthenticationTrustResolverInterface $trustResolver, HttpUtils $httpUtils, $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint = null, $errorPage = null, AccessDeniedHandlerInterface $accessDeniedHandler = null, LoggerInterface $logger = null)
51+
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationTrustResolverInterface $trustResolver, HttpUtils $httpUtils, $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint = null, $errorPage = null, AccessDeniedHandlerInterface $accessDeniedHandler = null, LoggerInterface $logger = null)
5852
{
5953
$this->tokenStorage = $tokenStorage;
6054
$this->accessDeniedHandler = $accessDeniedHandler;

src/Symfony/Component/Security/Http/Firewall/LogoutListener.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
1919
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
2020
use Symfony\Component\Security\Core\Exception\InvalidArgumentException;
21-
use Symfony\Component\Security\Core\SecurityContextInterface;
2221
use Symfony\Component\Security\Core\Exception\LogoutException;
2322
use Symfony\Component\Security\Csrf\CsrfToken;
2423
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
@@ -43,15 +42,13 @@ class LogoutListener implements ListenerInterface
4342
/**
4443
* Constructor.
4544
*
46-
* @param SecurityContextInterface|TokenStorageInterface $tokenStorage
47-
* @param HttpUtils $httpUtils An HttpUtilsInterface instance
48-
* @param LogoutSuccessHandlerInterface $successHandler A LogoutSuccessHandlerInterface instance
49-
* @param array $options An array of options to process a logout attempt
50-
* @param CsrfTokenManagerInterface $csrfTokenManager A CsrfTokenManagerInterface instance
51-
*
52-
* Passing a SecurityContextInterface as a first argument was deprecated in 2.7 and will be removed in 3.0
45+
* @param TokenStorageInterface $tokenStorage
46+
* @param HttpUtils $httpUtils An HttpUtilsInterface instance
47+
* @param LogoutSuccessHandlerInterface $successHandler A LogoutSuccessHandlerInterface instance
48+
* @param array $options An array of options to process a logout attempt
49+
* @param CsrfTokenManagerInterface $csrfTokenManager A CsrfTokenManagerInterface instance
5350
*/
54-
public function __construct($tokenStorage, HttpUtils $httpUtils, LogoutSuccessHandlerInterface $successHandler, array $options = array(), $csrfTokenManager = null)
51+
public function __construct(TokenStorageInterface $tokenStorage, HttpUtils $httpUtils, LogoutSuccessHandlerInterface $successHandler, array $options = array(), $csrfTokenManager = null)
5552
{
5653
if ($csrfTokenManager instanceof CsrfProviderInterface) {
5754
$csrfTokenManager = new CsrfProviderAdapter($csrfTokenManager);

src/Symfony/Component/Security/Http/Firewall/RememberMeListener.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
1717
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
1818
use Symfony\Component\Security\Core\Exception\AuthenticationException;
19-
use Symfony\Component\Security\Core\SecurityContextInterface;
2019
use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface;
2120
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
2221
use Symfony\Component\Security\Http\SecurityEvents;
@@ -39,16 +38,14 @@ class RememberMeListener implements ListenerInterface
3938
/**
4039
* Constructor.
4140
*
42-
* @param SecurityContextInterface|TokenStorageInterface $tokenStorage
43-
* @param RememberMeServicesInterface $rememberMeServices
44-
* @param AuthenticationManagerInterface $authenticationManager
45-
* @param LoggerInterface $logger
46-
* @param EventDispatcherInterface $dispatcher
47-
* @param bool $catchExceptions
48-
*
49-
* Passing a SecurityContextInterface as a first argument was deprecated in 2.7 and will be removed in 3.0
41+
* @param TokenStorageInterface $tokenStorage
42+
* @param RememberMeServicesInterface $rememberMeServices
43+
* @param AuthenticationManagerInterface $authenticationManager
44+
* @param LoggerInterface $logger
45+
* @param EventDispatcherInterface $dispatcher
46+
* @param bool $catchExceptions
5047
*/
51-
public function __construct($tokenStorage, RememberMeServicesInterface $rememberMeServices, AuthenticationManagerInterface $authenticationManager, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, $catchExceptions = true)
48+
public function __construct(TokenStorageInterface $tokenStorage, RememberMeServicesInterface $rememberMeServices, AuthenticationManagerInterface $authenticationManager, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, $catchExceptions = true)
5249
{
5350
$this->tokenStorage = $tokenStorage;
5451
$this->rememberMeServices = $rememberMeServices;

0 commit comments

Comments
 (0)
0