Serializer: Use the context in supports calls

This commit is contained in:
soyuka 2019-02-27 17:47:14 +01:00 committed by Kévin Dunglas
parent 129c616092
commit a02ad96336
No known key found for this signature in database
GPG Key ID: 4D04EBEF06AAF3A6
1 changed files with 2 additions and 2 deletions

View File

@ -237,7 +237,7 @@ class Serializer implements SerializerInterface, ContextAwareNormalizerInterface
if (!$normalizer instanceof CacheableSupportsMethodInterface || !$normalizer->hasCacheableSupportsMethod()) {
$this->normalizerCache[$format][$type][$k] = false;
} elseif ($normalizer->supportsNormalization($data, $format)) {
} elseif ($normalizer->supportsNormalization($data, $format, $context)) {
$this->normalizerCache[$format][$type][$k] = true;
break;
}
@ -278,7 +278,7 @@ class Serializer implements SerializerInterface, ContextAwareNormalizerInterface
if (!$normalizer instanceof CacheableSupportsMethodInterface || !$normalizer->hasCacheableSupportsMethod()) {
$this->denormalizerCache[$format][$class][$k] = false;
} elseif ($normalizer->supportsDenormalization(null, $class, $format)) {
} elseif ($normalizer->supportsDenormalization(null, $class, $format, $context)) {
$this->denormalizerCache[$format][$class][$k] = true;
break;
}