Skip to content

Commit 971e6e3

Browse files
bug symfony#20530 [Serializer] Remove AbstractObjectNormalizer::isAttributeToNormalize (dunglas)
This PR was squashed before being merged into the 3.1 branch (closes symfony#20530). Discussion ---------- [Serializer] Remove AbstractObjectNormalizer::isAttributeToNormalize | Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | yes | New feature? | no | BC breaks? | unclear | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a I've introduced this method by error in symfony#17113. It has been forgotten during a refactoring. It has always been unused, is not covered by our test suite and has never been documented. Technically it's a BC break (because this is a protected method), but I think that it's better to remove it has it has never be intended to be used, it's just a miss. An alternative is to deprecate it and remove it in v4. Commits ------- fea18aa [Serializer] Remove AbstractObjectNormalizer::isAttributeToNormalize
2 parents 1cd63e7 + fea18aa commit 971e6e3

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

UPGRADE-3.1.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ Serializer
111111
deprecated and will not be supported in Symfony 4.0. You should use the
112112
`CacheClassMetadataFactory` class instead.
113113

114+
* The `AbstractObjectNormalizer::isAttributeToNormalize()` method has been removed
115+
because it was initially added by mistake, has never been used and is not tested
116+
nor documented.
117+
114118
Translation
115119
-----------
116120

src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -208,20 +208,6 @@ public function denormalize($data, $class, $format = null, array $context = arra
208208
*/
209209
abstract protected function setAttributeValue($object, $attribute, $value, $format = null, array $context = array());
210210

211-
/**
212-
* Should this attribute be normalized?
213-
*
214-
* @param mixed $object
215-
* @param string $attributeName
216-
* @param array $context
217-
*
218-
* @return bool
219-
*/
220-
protected function isAttributeToNormalize($object, $attributeName, &$context)
221-
{
222-
return !in_array($attributeName, $this->ignoredAttributes) && !$this->isMaxDepthReached(get_class($object), $attributeName, $context);
223-
}
224-
225211
/**
226212
* Validates the submitted data and denormalizes it.
227213
*

0 commit comments

Comments
 (0)