-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow to set a null template #6196
Conversation
Maybe we could prevent this method to be called in that case. |
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.
Confirm, this working.
Yes we could write
But
was more convenient. And most of the setters of this class are allowing
Setting |
In my case I think it's just a personal preference. I haven't strong reasons against this behavior, just wondering why we should accept a value to be set and later to be resetted. IMO, disallowing the possibility to reset makes the class state more robust. I'm thinking about cases like the |
Is it ok for you if I merge this then ? |
I'm sorry, but I'd like to abstain from this vote in order to let other contributors to decide about making this kind of changes deliberately. |
IMHO FieldDescription working on specify AdminBundle scope. SonataDoctrineOrmBundle is extension and should override template for something better(other). Null value is taking from guesser, it can be fix by easy: if ( $newTemplate = $this->guessType($field)) {
Set it
} Sorry but i write it on my phone |
Subject
Targeting this branch, because the typehint was added in master.
SonataDoctrineOrmBundle call this setter with a possible null value.
Since the template is
null
by default, I updated the phpdoc and I don't see any problem with allowing to setnull
.