Skip to content

Commit

Permalink
bug #31071 property normalizer should also pass format and context to…
Browse files Browse the repository at this point in the history
… isAllowedAttribute (dbu)

This PR was merged into the 3.4 branch.

Discussion
----------

property normalizer should also pass format and context to isAllowedAttribute

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | found while working on #30888
| License       | MIT
| Doc PR        | -

the context and format are optional parameters to `isAllowedAttribute`, but should be forwarded. due to this omission, the PropertyNormalizer was ignoring the 'attributes' context option (and does in version 4 also ignore the 'ignore_attributes' context option - that one is a property on the normalizer class in version 3 and therefore not ignored here)

Commits
-------

13e2fb7 property normalizer should also pass format and context to isAllowedAttribute
  • Loading branch information
nicolas-grekas committed Apr 11, 2019
2 parents bd28ac6 + 13e2fb7 commit 2a1137a
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -102,7 +102,7 @@ protected function extractAttributes($object, $format = null, array $context = [

do {
foreach ($reflectionObject->getProperties() as $property) {
if (!$this->isAllowedAttribute($reflectionObject->getName(), $property->name)) {
if (!$this->isAllowedAttribute($reflectionObject->getName(), $property->name, $format, $context)) {
continue;
}

Expand Down

0 comments on commit 2a1137a

Please sign in to comment.