Skip to content

Commit

Permalink
Use default context EXCLUDE_FROM_CACHE_KEY for unsetting OBJECT_TO_PO…
Browse files Browse the repository at this point in the history
…PULATE
  • Loading branch information
alanpoulain committed Apr 6, 2020
1 parent f72dd9c commit dd38271
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
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] = [self::CIRCULAR_REFERENCE_LIMIT_COUNTERS, self::OBJECT_TO_POPULATE];

$this->propertyTypeExtractor = $propertyTypeExtractor;

Expand Down Expand Up @@ -617,7 +617,6 @@ private function getCacheKey(?string $format, array $context)
unset($context[$key]);
}
unset($context[self::EXCLUDE_FROM_CACHE_KEY]);
unset($context[self::OBJECT_TO_POPULATE]);
unset($context['cache_key']); // avoid artificially different keys

try {
Expand Down

0 comments on commit dd38271

Please sign in to comment.