Skip to content

Commit

Permalink
[Serializer] Fix configuration of the cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Apr 4, 2020
1 parent 38cbcc6 commit 2875404
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -115,7 +115,7 @@ public function __construct(ClassMetadataFactoryInterface $classMetadataFactory
throw new InvalidArgumentException(sprintf('The "%s" given in the default context is not callable.', self::MAX_DEPTH_HANDLER));
}

$this->defaultContext[self::EXCLUDE_FROM_CACHE_KEY] = [self::CIRCULAR_REFERENCE_LIMIT_COUNTERS];
$this->defaultContext[self::EXCLUDE_FROM_CACHE_KEY] = array_merge($this->defaultContext[self::EXCLUDE_FROM_CACHE_KEY] ?? [], [self::CIRCULAR_REFERENCE_LIMIT_COUNTERS]);

$this->propertyTypeExtractor = $propertyTypeExtractor;

Expand Down Expand Up @@ -359,7 +359,7 @@ public function denormalize($data, $type, $format = null, array $context = [])
try {
$this->setAttributeValue($object, $attribute, $value, $format, $context);
} catch (InvalidArgumentException $e) {
throw new NotNormalizableValueException(sprintf('Failed to denormalize attribute "%s" value for class "%s": %s.', $attribute, $type, $e->getMessage()), $e->getCode(), $e);
throw new NotNormalizableValueException(sprintf('Failed to denormalize attribute "%s" value for class "%s": "%s".', $attribute, $type, $e->getMessage()), $e->getCode(), $e);
}
}

Expand Down

0 comments on commit 2875404

Please sign in to comment.