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()) {
|
if (!$normalizer instanceof CacheableSupportsMethodInterface || !$normalizer->hasCacheableSupportsMethod()) {
|
||||||
$this->normalizerCache[$format][$type][$k] = false;
|
$this->normalizerCache[$format][$type][$k] = false;
|
||||||
} elseif ($normalizer->supportsNormalization($data, $format)) {
|
} elseif ($normalizer->supportsNormalization($data, $format, $context)) {
|
||||||
$this->normalizerCache[$format][$type][$k] = true;
|
$this->normalizerCache[$format][$type][$k] = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -278,7 +278,7 @@ class Serializer implements SerializerInterface, ContextAwareNormalizerInterface
|
|||||||
|
|
||||||
if (!$normalizer instanceof CacheableSupportsMethodInterface || !$normalizer->hasCacheableSupportsMethod()) {
|
if (!$normalizer instanceof CacheableSupportsMethodInterface || !$normalizer->hasCacheableSupportsMethod()) {
|
||||||
$this->denormalizerCache[$format][$class][$k] = false;
|
$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;
|
$this->denormalizerCache[$format][$class][$k] = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user