10000 Prevent auto-registration of UserPasswordEncoderCommand · symfony/symfony@21f7c75 · GitHub
[go: up one dir, main page]

Skip to content

Commit 21f7c75

Browse files
committed
Prevent auto-registration of UserPasswordEncoderCommand
1 parent 82ec56b commit 21f7c75

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ public function load(array $configs, ContainerBuilder $container)
9898

9999
if ($config['encoders']) {
100100
$this->createEncoders($config['encoders'], $container);
101+
}
101102

102-
if (class_exists(Application::class)) {
103-
$loader->load('console.xml');
104-
$container->getDefinition('security.console.user_password_encoder_command')->replaceArgument(1, array_keys($config['encoders']));
105-
}
103+
if (class_exists(Application::class)) {
104+
$loader->load('console.xml');
105+
$container->getDefinition('security.console.user_password_encoder_command')->replaceArgument(1, array_keys($config['encoders']));
106106
}
107107

108108
// load ACL

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ public function testUserCheckerConfigWithNoCheckers()
345345
$this->assertEquals('security.user_checker', $this->getContainer('container1')->getAlias('security.user_checker.secure'));
346346
}
347347

348+
public function testUserPasswordEncoderCommandIsRegistered()
349+
{
350+
$this->assertTrue($this->getContainer('container1')->has('security.console.user_password_encoder_command'));
351+
}
352+
348353
protected function getContainer($file)
349354
{
350355
$file = $file.'.'.$this->getFileExtension();

0 commit comments

Comments
 (0)
0