public function supportsEncoding($format) { try { $encoder = $this->getEncoder($format); } catch (\RuntimeException $e) { return false; } return $encoder instanceof EncoderInterface; }