Skip to content

Commit

Permalink
[SecurityBundle] Remove dead class_exists checks
Browse files Browse the repository at this point in the history
  • Loading branch information
chalasr committed May 22, 2022
1 parent d25741b commit 4d5f495
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
4 changes: 0 additions & 4 deletions DependencyInjection/Security/Factory/LdapFactoryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ public function getKey(): string
public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, string $userProviderId): string
{
$key = str_replace('-', '_', $this->getKey());
if (!class_exists(LdapAuthenticator::class)) {
throw new \LogicException(sprintf('The "%s" authenticator requires the "symfony/ldap" package version "5.1" or higher.', $key));
}

$authenticatorId = parent::createAuthenticator($container, $firewallName, $config, $userProviderId);

$container->setDefinition('security.listener.'.$key.'.'.$firewallName, new Definition(CheckLdapCredentialsListener::class))
Expand Down
5 changes: 0 additions & 5 deletions DependencyInjection/Security/Factory/LoginLinkFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
use Symfony\Component\Security\Http\LoginLink\LoginLinkHandler;

/**
* @internal
Expand Down Expand Up @@ -88,10 +87,6 @@ public function getKey(): string

public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, string $userProviderId): string
{
if (!class_exists(LoginLinkHandler::class)) {
throw new \LogicException('Login login link requires symfony/security-http:^5.2.');
}

if (!$container->hasDefinition('security.authenticator.login_link')) {
$loader = new PhpFileLoader($container, new FileLocator(\dirname(__DIR__).'/../../Resources/config'));
$loader->load('security_authenticator_login_link.php');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpFoundation\RateLimiter\RequestRateLimiterInterface;
use Symfony\Component\RateLimiter\RateLimiterFactory;
use Symfony\Component\Security\Http\EventListener\LoginThrottlingListener;
use Symfony\Component\Security\Http\RateLimiter\DefaultLoginRateLimiter;

/**
Expand Down Expand Up @@ -67,10 +66,6 @@ public function addConfiguration(NodeDefinition $builder)

public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, string $userProviderId): array
{
if (!class_exists(LoginThrottlingListener::class)) {
throw new \LogicException('Login throttling requires symfony/security-http:^5.2.');
}

if (!class_exists(RateLimiterFactory::class)) {
throw new \LogicException('Login throttling requires the Rate Limiter component. Try running "composer require symfony/rate-limiter".');
}
Expand Down

0 comments on commit 4d5f495

Please sign in to comment.