8000 minor #59133 Remove ServiceSubscriberInterface implementation from Se… · symfony/symfony@8c841e3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8c841e3

Browse files
committed
minor #59133 Remove ServiceSubscriberInterface implementation from Service façade (derrabus)
This PR was merged into the 7.3 branch. Discussion ---------- Remove ServiceSubscriberInterface implementation from Service façade | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | Follow-up to #48142 | License | MIT #48142 added a `ServiceSubscriberInterface` implementation to our `Security` façade, but that implementation is never consumed. If we did that, we would fail because the `security.firewall.event_dispatcher_locator` is hinted as a generic `ServiceLocator` which we cannot autowire. This is why I'd like to remove that implementation. Commits ------- a185129 Remove ServiceSubscriberInterface implementation
2 parents 8b271eb + a185129 commit 8c841e3

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

src/Symfony/Bundle/SecurityBundle/Security.php

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,21 @@
1313

1414
use Psr\Container\ContainerInterface;
1515
use Symfony\Bundle\SecurityBundle\Security\FirewallConfig;
16-
use Symfony\Component\DependencyInjection\ServiceLocator;
1716
use Symfony\Component\HttpFoundation\Request;
18-
use Symfony\Component\HttpFoundation\RequestStack;
1917
use Symfony\Component\HttpFoundation\Response;
2018
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
2119
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
2220
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
2321
use Symfony\Component\Security\Core\Authorization\UserAuthorizationCheckerInterface;
2422
use Symfony\Component\Security\Core\Exception\LogicException;
2523
use Symfony\Component\Security\Core\Exception\LogoutException;
26-
use Symfony\Component\Security\Core\User\UserCheckerInterface;
2724
use Symfony\Component\Security\Core\User\UserInterface;
2825
use Symfony\Component\Security\Csrf\CsrfToken;
29-
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
3026
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
3127
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\BadgeInterface;
3228
use Symfony\Component\Security\Http\Event\LogoutEvent;
33-
use Symfony\Component\Security\Http\FirewallMapInterface;
3429
use Symfony\Component\Security\Http\ParameterBagUtils;
3530
use Symfony\Contracts\Service\ServiceProviderInterface;
36-
use Symfony\Contracts\Service\ServiceSubscriberInterface;
3731

3832
/**
3933
* Helper class for commonly-needed security tasks.
@@ -44,7 +38,7 @@
4438
*
4539
* @final
4640
*/
47-
class Security implements AuthorizationCheckerInterface, ServiceSubscriberInterface, UserAuthorizationCheckerInterface
41+
class Security implements AuthorizationCheckerInterface, UserAuthorizationCheckerInterface
4842
{
4943
public function __construct(
5044
private readonly ContainerInterface $container,
@@ -200,19 +194,4 @@ private function getAuthenticator(?string $authenticatorName, string $firewallNa
200194

201195
return $firewallAuthenticatorLocator->get($authenticatorId);
202196
}
203-
204-
public static function getSubscribedServices(): array
205-
{
206-
return [
207-
'security.token_storage' => TokenStorageInterface::class,
208-
'security.authorization_checker' => AuthorizationCheckerInterface::class,
209-
'security.user_authorization_checker' => UserAuthorizationCheckerInterface::class,
210-
'security.authenticator.managers_locator' => '?'.ServiceProviderInterface::class,
211-
'request_stack' => RequestStack::class,
212-
'security.firewall.map' => FirewallMapInterface::class,
213-
'security.user_checker' => UserCheckerInterface::class,
214-
'security.firewall.event_dispatcher_locator' => ServiceLocator::class,
215-
'security.csrf.token_manager' => '?'.CsrfTokenManagerInterface::class,
216-
];
217-
}
218197
}

0 commit comments

Comments
 (0)
0