Skip to content

Commit 7fff19a

Browse files
committed
normalize string values to a single ExposeSecurityLevel instance
1 parent 54cbb6a commit 7fff19a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

DependencyInjection/MainConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getConfigTreeBuilder(): TreeBuilder
7676
->setDeprecated('symfony/security-bundle', '7.3', 'The "%node%" option is deprecated and will be removed in 8.0. Use the "expose_security_errors" option instead.')
7777
->end()
7878
->enumNode('expose_security_errors')
79-
->beforeNormalization()->ifString()->then(fn ($v) => ['value' => ExposeSecurityLevel::tryFrom($v)])->end()
79+
->beforeNormalization()->ifString()->then(fn ($v) => ExposeSecurityLevel::tryFrom($v))->end()
8080
->values(ExposeSecurityLevel::cases())
8181
->defaultValue(ExposeSecurityLevel::None)
8282
->end()

Tests/DependencyInjection/MainConfigurationTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ public static function provideHideUserNotFoundData(): iterable
254254
yield [['expose_security_errors' => ExposeSecurityLevel::None], ExposeSecurityLevel::None];
255255
yield [['expose_security_errors' => ExposeSecurityLevel::AccountStatus], ExposeSecurityLevel::AccountStatus];
256256
yield [['expose_security_errors' => ExposeSecurityLevel::All], ExposeSecurityLevel::All];
257+
yield [['expose_security_errors' => 'none'], ExposeSecurityLevel::None];
258+
yield [['expose_security_errors' => 'account_status'], ExposeSecurityLevel::AccountStatus];
259+
yield [['expose_security_errors' => 'all'], ExposeSecurityLevel::All];
257260
}
258261

259262
/**

0 commit comments

Comments
 (0)