Gets the encoder supporting the format.
string $format:
RuntimeException if no encoder is found
private function getEncoder($format) {
if (isset($this->encoderByFormat[$format]) && isset($this->encoders[$this->encoderByFormat[$format]])) {
return $this->encoders[$this->encoderByFormat[$format]];
}
foreach ($this->encoders as $i => $encoder) {
if ($encoder
->supportsEncoding($format)) {
$this->encoderByFormat[$format] = $i;
return $encoder;
}
}
throw new RuntimeException(sprintf('No encoder found for format "%s".', $format));
}