[Serializer] Check the value of enable_max_depth if defined

This commit is contained in:
Kévin Dunglas 2018-05-24 13:48:55 +02:00
parent 985ef53b51
commit e88e0f30f1
No known key found for this signature in database
GPG Key ID: 4D04EBEF06AAF3A6

View File

@ -333,6 +333,7 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
{
if (
!isset($context[static::ENABLE_MAX_DEPTH]) ||
!$context[static::ENABLE_MAX_DEPTH] ||
!isset($attributesMetadata[$attribute]) ||
null === $maxDepth = $attributesMetadata[$attribute]->getMaxDepth()
) {