You are here

public function ChainEncoder::supportsEncoding 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::supportsEncoding()

Checks whether the serializer can encode to given format.

Parameters

string $format format name:

Return value

bool

Overrides EncoderInterface::supportsEncoding

File

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

Class

ChainEncoder
Encoder delegating the decoding to a chain of encoders.

Namespace

Symfony\Component\Serializer\Encoder

Code

public function supportsEncoding($format) {
  try {
    $this
      ->getEncoder($format);
  } catch (RuntimeException $e) {
    return false;
  }
  return true;
}