Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Validator] Make ExpressionLanguageSyntax validator usable with annotation#36886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
jderusse commentedMay 20, 2020
ping@Andrej-in-ua |
| } | ||
| } | ||
| privatefunctiongetExpressionLanguage():ExpressionLanguage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
inspired from
symfony/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php
Lines 53 to 60 in93248c9
| privatefunctiongetExpressionLanguage():ExpressionLanguage | |
| { | |
| if (null ===$this->expressionLanguage) { | |
| $this->expressionLanguage =newExpressionLanguage(); | |
| } | |
| return$this->expressionLanguage; | |
| } |
src/Symfony/Component/Validator/Constraints/ExpressionLanguageSyntaxValidator.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Validator/Constraints/ExpressionLanguageSyntaxValidator.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
fabpot commentedMay 22, 2020
Thank you@jderusse. |
When using the new on an entity ExpressionLanguageSyntax (basicaly copy/pasted the sample fromhttps://symfony.com/blog/new-in-symfony-5-1-expressionlanguage-validator), I face a first error:
indeed, the
serviceisneed to generate a valide aliasWhich looks weird for a Constraint
This PR makes the ExpressionLanguage dependency optionnal in
ExpressionLanguageSyntaxValidator, and removes theservicethan is not needed anyore