Skip to content

Commit b119692

Browse files
committed
minor #20476 [Validator] Fix the configuration for custom password strength estimator (stof)
This PR was merged into the 7.2 branch. Discussion ---------- [Validator] Fix the configuration for custom password strength estimator Fixes symfony/symfony#59235 `service_closure` is about building an argument being a closure **returning** that service. This is not what we need for the custom estimator, where we need to inject the estimator callable. Commits ------- 8aeceab Fix the configuration for custom password strength estimator
2 parents 53ea654 + 8aeceab commit b119692

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

reference/constraints/PasswordStrength.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ service to use your own estimator:
178178
class: App\Validator\CustomPasswordStrengthEstimator
179179
180180
Symfony\Component\Validator\Constraints\PasswordStrengthValidator:
181-
arguments: [!service_closure '@custom_password_strength_estimator']
181+
arguments: [!closure '@custom_password_strength_estimator']
182182
183183
.. code-block:: xml
184184
@@ -192,7 +192,7 @@ service to use your own estimator:
192192
<service id="custom_password_strength_estimator" class="App\Validator\CustomPasswordStrengthEstimator"/>
193193
194194
<service id="Symfony\Component\Validator\Constraints\PasswordStrengthValidator">
195-
<argument type="service_closure" id="custom_password_strength_estimator"/>
195+
<argument type="closure" id="custom_password_strength_estimator"/>
196196
</service>
197197
</services>
198198
</container>
@@ -210,5 +210,5 @@ service to use your own estimator:
210210
$services->set('custom_password_strength_estimator', CustomPasswordStrengthEstimator::class);
211211
212212
$services->set(PasswordStrengthValidator::class)
213-
->args([service_closure('custom_password_strength_estimator')]);
213+
->args([closure('custom_password_strength_estimator')]);
214214
};

0 commit comments

Comments
 (0)