Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Removing the alias stuff - not required after symfony/symfony#17074#6746

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

Merged
weaverryan merged 2 commits into2.7fromcustom_constraint_tweak
Aug 2, 2016

Conversation

@weaverryan
Copy link
Member

Thanks tosymfony/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.

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``
Copy link
Member

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 bevalidateBy() (we suffix all methods mentioned by parenthesis)

@wouterj
Copy link
Member

Status: Reviewed

@weaverryanweaverryanforce-pushed thecustom_constraint_tweak branch fromf0cec18 to31afb0eCompareAugust 2, 2016 00:39
@weaverryanweaverryan merged commit31afb0e into2.7Aug 2, 2016
weaverryan added a commit that referenced this pull requestAug 2, 2016
…ymfony#17074 (weaverryan)This PR was merged into the 2.7 branch.Discussion----------Removing the alias stuff - not required aftersymfony/symfony#17074Thanks tosymfony/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 break2ec049d Removing the alias stuff - not required aftersymfony/symfony#17074
@xabbuhxabbuh deleted the custom_constraint_tweak branchAugust 2, 2016 16:29
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).
Copy link
Member

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?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@weaverryan@wouterj@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp