-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Serializer] Fixed array_unique
on array of objects in getAllowedAttributes
.
#16450
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
Conversation
ksm2
commented
Nov 3, 2015
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #16445 |
License | MIT |
Doc PR | symfony/symfony-docs#16445 |
Can you add a test case? |
$allowedAttributes = array_unique($allowedAttributes); | ||
} | ||
|
||
return $allowedAttributes; |
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 could be inlined:
return $attributesAsString ? array_unique($allowedAttributes) : $allowedAttributes;
d311645
to
3da6f29
Compare
IMO |
IIUC, the |
It can with the metadata implementation provided in Symfony. +1 for removing the call and adding a mention in the metadata interface that it's the responsibility of the implantation to return an uniquified list of attributes. |
@CornyPhoenix What's the status of this PR? |
…ts in `getAllowedAttributes`.
… as objects or strings.
…ts in `getAllowedAttributes`.
… as objects or strings.
@fabpot I am sorry for the late response. I removed the |
👍 |
@dunglas Which version should we merge this PR in? |
2.7 IMO but not sure. I'll take a look and merge it. |
Thank you @CornyPhoenix. |
…getAllowedAttributes`. (CornyPhoenix) This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #16450). Discussion ---------- [Serializer] Fixed `array_unique` on array of objects in `getAllowedAttributes`. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #16445 | License | MIT | Doc PR | symfony/symfony-docs#16445 Commits ------- 6110bd9 [Serializer] Fixed on array of objects in .
This PR was merged in 2.7, that require "php": ">=5.3.9" but in PR used short array syntax [] at tests and it is intoroduced at 5.4 @fabpot Is it ok, or must be fixed by another PR? |
@ewgRa short syntax should be removed. Fancy a PR? :) |