You are here

public function ChainEncoder::needsNormalization in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Encoder/ChainEncoder.php \Symfony\Component\Serializer\Encoder\ChainEncoder::needsNormalization()

Checks whether the normalization is needed for the given format.

Parameters

string $format:

Return value

bool

File

vendor/symfony/serializer/Encoder/ChainEncoder.php, line 62

Class

ChainEncoder
Encoder delegating the decoding to a chain of encoders.

Namespace

Symfony\Component\Serializer\Encoder

Code

public function needsNormalization($format) {
  $encoder = $this
    ->getEncoder($format);
  if (!$encoder instanceof NormalizationAwareInterface) {
    return true;
  }
  if ($encoder instanceof self) {
    return $encoder
      ->needsNormalization($format);
  }
  return false;
}