-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing the alias stuff - not required after symfony/symfony#17074 #6746
Conversation
Make sure to use the 'alias_name' when you have configured your validator as a service. Otherwise your validator class | ||
will be simply instantiated without your dependencies. | ||
In earlier versions of Symfony, the tag required an ``alias`` key (usually set | ||
to the class name). This is still allowed your constraint's ``validateBy`` |
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.
this sentence is missing something between "This is still allowed" and "your constraint's [...]". Maybe "and" or a comma or just a rewording :)
Also, it should be validateBy()
(we suffix all methods mentioned by parenthesis)
Status: Reviewed |
f0cec18
to
31afb0e
Compare
…ymfony#17074 (weaverryan) This PR was merged into the 2.7 branch. Discussion ---------- Removing the alias stuff - not required after symfony/symfony#17074 Thanks to symfony/symfony#17074 (merged all the way back into 2.3), `alias` is not required anymore. So why mention it? As I understand it, validators work like the new form types: it's ok that `validatedBy returns a class name: the validation system will notice that you have a tagged service matching this class and will use that instead of creating it new. Commits ------- 31afb0e line break 2ec049d Removing the alias stuff - not required after symfony/symfony#17074
will be simply instantiated without your dependencies. | ||
In earlier versions of Symfony, the tag required an ``alias`` key (usually set | ||
to the class name). This is still allowed your constraint's ``validateBy`` | ||
method can return this alias (instead of a class name). |
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.
@weaverryan The last sentence reads weird. Was it meant to be this way?
Thanks to symfony/symfony#17074 (merged all the way back into 2.3),
alias
is not required anymore. So why mention it?As I understand it, validators work like the new form types: it's ok that `validatedBy returns a class name: the validation system will notice that you have a tagged service matching this class and will use that instead of creating it new.