function ChainEncoder::needsNormalization
Checks whether the normalization is needed for the given format.
File
-
vendor/
symfony/ serializer/ Encoder/ ChainEncoder.php, line 60
Class
- ChainEncoder
- Encoder delegating the decoding to a chain of encoders.
Namespace
Symfony\Component\Serializer\EncoderCode
public function needsNormalization(string $format, array $context = []) : bool {
$encoder = $this->getEncoder($format, $context);
if ($encoder instanceof TraceableEncoder) {
return $encoder->needsNormalization();
}
if (!$encoder instanceof NormalizationAwareInterface) {
return true;
}
if ($encoder instanceof self) {
return $encoder->needsNormalization($format, $context);
}
return false;
}