-
-
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
Manual merge #6689
Manual merge #6689
Conversation
as this is a final class.
…ject#6685) This reverts commit 7c470b0.
sonata.admin.configuration replaces sonata.admin.pool when it comes to configuration, this add tests to replace the pool service.
$this->prefix = $prefix ?? $formBuilder->getName(); | ||
$this->prefix = $prefix ?: $formBuilder->getName(); |
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'm wondering if ??
is not better than ?:
in this 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.
I guess not:
$this->prefix = $prefix ?? $formBuilder->getName(); // will always return $prefix ($prefix is not null)
$this->prefix = $prefix ?: $formBuilder->getName(); // will return $formBuilder->getName(); in case $prefix is false
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.
$prefix is null or a string.
If someone pass ''
, shouldn't we use ''
as a prefix instead of overriding the prefix to $formBuilder->getName() ?
IMHO we should only override the prefix if null is passed. That's the job of ??
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.
My comment was based on the phpdoc:
/**
* @param bool $prefix
*/
public function __construct(FormBuilderInterface $formBuilder, $prefix = false)
{
I haven't check the usages to see if it can be a string
, if so, the phpdoc should be updated.
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.
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.
Looking at the usages, the only place where the $prefix
was passed is:
return new self($this->formBuilder->get($this->iterator->current()), $this->current()); |
In master
that argument was removed in #6533, I don't know what was the use of this, but looks like it should have been deprecated in 3.x
and removed in master
.
No description provided.