Serializer: Use the context in supports calls
This commit is contained in:
parent
129c616092
commit
a02ad96336
|
@ -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;
|
||||
}
|
||||
|
|
Reference in New Issue