Skip to content

Commit 74a5f3d

Browse files
committed
Use Composer InstalledVersions to check if flex is installed instead of existence of InstallRecipesCommand
1 parent 155ac0d commit 74a5f3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

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

1212
namespace Symfony\Bundle\SecurityBundle\DependencyInjection;
1313

14+
use Composer\InstalledVersions;
1415
use Symfony\Bridge\Twig\Extension\LogoutUrlExtension;
1516
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AuthenticatorFactoryInterface;
1617
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FirewallListenerFactoryInterface;
@@ -60,7 +61,6 @@
6061
use Symfony\Component\Security\Core\User\UserProviderInterface;
6162
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticatorManagerListener;
6263
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
63-
use Symfony\Flex\Command\InstallRecipesCommand;
6464

6565
/**
6666
* SecurityExtension.
@@ -91,7 +91,7 @@ public function prepend(ContainerBuilder $container): void
9191
public function load(array $configs, ContainerBuilder $container): void
9292
{
9393
if (!array_filter($configs)) {
94-
$hint = class_exists(InstallRecipesCommand::class) ? 'Try running "composer symfony:recipes:install symfony/security-bundle".' : 'Please define your settings for the "security" config section.';
94+
$hint = class_exists(InstalledVersions::class) && InstalledVersions::isInstalled('symfony/flex') ? 'Try running "composer symfony:recipes:install symfony/security-bundle".' : 'Please define your settings for the "security" config section.';
9595

9696
throw new InvalidConfigurationException('The SecurityBundle is enabled but is not configured. '.$hint);
9797
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy