Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[PropertyAccess] fix adder/setter priority#29350
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
karser commentedNov 27, 2018
| Q | A |
|---|---|
| Branch? | 3.4 |
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | it fixes BC break introduced by#28966 |
| Deprecations? | no |
| Tests pass? | no, so far it is a reproducer |
| Fixed tickets | #29340 |
| License | MIT |
karser commentedNov 27, 2018
I reverted (locally) changes from#28966 and I'm trying to fix it differently. @xabbuh indeed, the problem is in I added a check if the property name plural. So it uses adder/remover only if the property name is actual plural. That is - @xabbuh@nicolas-grekas makes sense? |
xabbuh commentedNov 27, 2018
my idea to fix the issue would be#29355 |
karser commentedNov 27, 2018
@xabbuh I see - it shouldn't cache the What do you think of this approach? |
9db236e toea447cbCompare| $camelized =$this->camelize($property); | ||
| $singulars = (array) Inflector::singularize($camelized); | ||
| if ($useAdderAndRemover && !\in_array($camelized,$singulars)) { |
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.
unfortunately, this does not work for words where singular and plural are the same (aircraft for example)
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.
see the added test in#29355
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.
Yeah, there is a lot of exceptionsThat are Both Plural and Singular. Although I'm still confused why an empty array is passed togetWriteAccessInfo(). Just to implicitly allow adder/remover?
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.
Probably something like that, though I don't know for sure. Maybe the git history reveals some more background information.
nicolas-grekas commentedNov 29, 2018
Closing in favor of#29355, thanks for your help! |


