Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Validator] fixed duplicate constraints with parent class interfaces#19580
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| if ('Symfony\Component\Validator\GroupSequenceProviderInterface' ===$interface->name) { | ||
| if ( | ||
| 'Symfony\Component\Validator\GroupSequenceProviderInterface' ===$interface->name || | ||
| $parent &&$parent->implementsInterface($interface->name) |
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.
Does it work for a child of a child?
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 think it should work 😉 No matter at which level (starting at the parent then going upwards to the parent of the parent etc.) the interface is implemented this condition will be true.
Or what exactly do you mean?
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 mean I was wondering about the pertinence of adding a test for it but you look pretty sure :)
f411c08 to7b4d8b1Compare| foreach ($metadata->getReflectionClass()->getInterfaces()as$interface) { | ||
| if ('Symfony\Component\Validator\GroupSequenceProviderInterface' ===$interface->name) { | ||
| if ('Symfony\Component\Validator\GroupSequenceProviderInterface' ===$interface->name | ||
| ||$parent &&$parent->implementsInterface($interface->name) |
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'd keep the condition in a single line, but add parenthesis to make precedence explicit.
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.
We don't enforce line length in Symfony, so keeping everything on one line is the way to go.
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 changed it 👍
dmaicher commentedAug 10, 2016
@webmozart you are probably the most qualified to say if this fix is correct? 😊 |
dmaicher commentedAug 21, 2016
@fabpot@stof@nicolas-grekas who could have a look at this? 😊 |
nicolas-grekas commentedAug 23, 2016
👍 |
fabpot commentedAug 23, 2016
Thank you@dmaicher. |
…interfaces (dmaicher)This PR was merged into the 2.7 branch.Discussion----------[Validator] fixed duplicate constraints with parent class interfaces| Q | A| ------------- | ---| Branch? | 2.7| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#19516| License | MIT| Doc PR | -Thisfixes#19516Commits-------fb36c5a [Validator] fixed duplicate constraints with parent class interfaces
Uh oh!
There was an error while loading.Please reload this page.
Thisfixes#19516