10000 Validation groups name best practice · Issue #12543 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Validation groups name best practice #12543

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

Closed
michnaadam33 opened this issue Oct 24, 2019 · 4 comments
Closed

Validation groups name best practice #12543

michnaadam33 opened this issue Oct 24, 2019 · 4 comments

Comments

@michnaadam33
Copy link

Are there any good practices for 'validation groups' name style?
I see that in documentation in some case we have Default (ucfirst) and in the other registration (strtolower).
What about multiple word name. Should it be a camelaCase or PascalCase?

Thank you for answer

@javiereguiluz
Copy link
Member

This is a good question ... let's ask @xabbuh and @wouterj which would be their "best practice" to name validation groups. Thanks!

@wouterj
Copy link
Member
wouterj commented May 28, 2020

By default, Symfony has a Default validation group and a ClassName (e.g. User) validation group.

I haven't used this feature ever in an application, but I would say it's better to not use PascalCase for custom groups - to differentiate between the ClassName groups and custom groups. I'm leaning towards under_scored, but that's 100% personal preference :)

@xabbuh
Copy link
Member
xabbuh commented May 28, 2020

I agree with Wouter.

@javiereguiluz
Copy link
Member

Thanks for your feedback. We added it in #13720.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0