Skip to content

Commit

Permalink
minor #20476 [Validator] Fix the configuration for custom password st…
Browse files Browse the repository at this point in the history
…rength 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
  • Loading branch information
javiereguiluz committed Dec 17, 2024
2 parents 53ea654 + 8aeceab commit b119692
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reference/constraints/PasswordStrength.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ service to use your own estimator:
class: App\Validator\CustomPasswordStrengthEstimator
Symfony\Component\Validator\Constraints\PasswordStrengthValidator:
arguments: [!service_closure '@custom_password_strength_estimator']
arguments: [!closure '@custom_password_strength_estimator']
.. code-block:: xml
Expand All @@ -192,7 +192,7 @@ service to use your own estimator:
<service id="custom_password_strength_estimator" class="App\Validator\CustomPasswordStrengthEstimator"/>
<service id="Symfony\Component\Validator\Constraints\PasswordStrengthValidator">
<argument type="service_closure" id="custom_password_strength_estimator"/>
<argument type="closure" id="custom_password_strength_estimator"/>
</service>
</services>
</container>
Expand All @@ -210,5 +210,5 @@ service to use your own estimator:
$services->set('custom_password_strength_estimator', CustomPasswordStrengthEstimator::class);
$services->set(PasswordStrengthValidator::class)
->args([service_closure('custom_password_strength_estimator')]);
->args([closure('custom_password_strength_estimator')]);
};

0 comments on commit b119692

Please sign in to comment.