You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature symfony#21792 [Security] deprecate multiple providers in context listener (xabbuh)
This PR was squashed before being merged into the 3.3-dev branch (closessymfony#21792).
Discussion
----------
[Security] deprecate multiple providers in context listener
Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Passing multiple user providers to the context listener does not make
much sense. The listener is only responsible to refresh users for a
particular firewall. Thus, it must only be aware of the user provider
for this particular firewall.
Commits
-------
53df0de [Security] deprecate multiple providers in context listener
fbd9f88 [SecurityBundle] only pass relevant user provider
thrownew \InvalidArgumentException('$contextKey must not be empty.');
51
59
}
52
60
61
+
if (is_array($userProviders)) {
62
+
@trigger_error(sprintf('Being able to pass multiple user providers to the constructor of %s is deprecated since version 3.3 and will not be supported anymore in 4.0. Only pass the user provider for the current firewall context instead.', __CLASS__), E_USER_DEPRECATED);
63
+
} else {
64
+
$userProviders = array($userProviders);
65
+
}
66
+
53
67
foreach ($userProvidersas$userProvider) {
54
68
if (!$userProviderinstanceof UserProviderInterface) {
55
69
thrownew \InvalidArgumentException(sprintf('User provider "%s" must implement "Symfony\Component\Security\Core\User\UserProviderInterface".', get_class($userProvider)));
0 commit comments