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
[fw-bundle] Add support for validator auto-mapping #559
Conversation
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.
Pull request passes validation.
# Enables validator auto-mapping support. | ||
# For instance, basic validation constraints will be inferred from Doctrine's metadata. | ||
auto_mapping: | ||
App\Entity\: [] |
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.
I keep thinking that this might make more sense as an annotation o the class not here. Currently, I look at my class to find all my constraints. Now I will possibly have these “silent” constraints I can’t track down. Could we activate the auto-constraints... with a constraint? We could generate entities with this by default with make:entity.
I know, wrong place to discuss - I just didn’t make it in time to the original Pr.
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 is a config which applies to all entities in given namespace, not specific class. How would you do that with annotation? Where would you put such annotation?
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 config supports setting full namespaces, as here, but also a list of specific classes using the glob syntax.
There is no annotations because it’s a bundle config. Only XML and YAML are supported. It’s similar to the service discovery config.
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.
And in almost all cases, it’s safer to always enable autovalidation. If it triggers a false positive, it’s most likely because the user is doing something very wrong that should be fixed.
2eafd3c
to
5fa21eb
Compare
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.
Pull request does not pass validation.
Recipe updated to use symlinks. Is it ok to use symlinks for whole directories too? (It's why the check is red right now). I tested it with 4.3 beta and DoctrineBundle master, and it works as expected. |
Yes conceptually, no technically apparently :) @fabpot can we adapt the check? |
@symfony-flex-server review |
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.
Pull request does not pass validation.
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.
Pull request does not pass validation.
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.
Pull request does not pass validation.
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.
Pull request does not pass validation.
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.
Pull request does not pass validation.
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.
Pull request does not pass validation.
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.
Pull request does not pass validation.
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.
Pull request does not pass validation.
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.
Pull request does not pass validation.
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.
Pull request passes validation.
@symfony-flex-server review |
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.
Pull request passes validation.
@dunglas @nicolas-grekas Flex server fixed, recipe is green, BUT you should test it to be sure that it works correctly. |
On my machine (Mac OS 10.14), symlinked files are not created during Reproducer:
|
I confirm the issue: a project created a few days ago contains |
Problem with symlinked files is fixed now. |
And this PR seems to work fine. @dunglas Can you confirm? |
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.
Pull request passes validation.
Good idea. It's where this config belongs. Updated. |
And I confirm this PR works as expected! |
Enables symfony/symfony#27735 by default.