private function getDecoder(string $format, array $context): DecoderInterface
    {
        if (isset($this->decoderByFormat[$format])
            && isset($this->decoders[$this->decoderByFormat[$format]])
        ) {
            return $this->decoders[$this->decoderByFormat[$format]];
        }

        foreach ($this->decoders as $i => $decoder) {
            if ($decoder->supportsDecoding($format, $context)) {
                $this->decoderByFormat[$format] = $i;

                return $decoder;
            }
        }

        throw new RuntimeException(sprintf('No decoder found for format "%s".', $format));
    }
private function getDecoder(string $format, array $context): DecoderInterface
    {
        if (isset($this->decoderByFormat[$format])
            && isset($this->decoders[$this->decoderByFormat[$format]])
        ) {
            return $this->decoders[$this->decoderByFormat[$format]];
        }

        foreach ($this->decoders as $i => $decoder) {
            if ($decoder->supportsDecoding($format, $context)) {
                $this->decoderByFormat[$format] = $i;

                return $decoder;
            }
        }

        throw new RuntimeException(sprintf('No decoder found for format "%s".', $format));
    }
private function getDecoder ( string $ format , array $ context ) : DecoderInterface { if ( isset ( $ this -> decoderByFormat [ $ format ] ) && isset ( $ this -> decoders [ $ this -> decoderByFormat [ $ format ] ] ) ) { return $ this -> decoders [ $ this -> decoderByFormat [ $ format ] ] ; } foreach ( $ this -> decoders as $ i => $ decoder ) { if ( $ decoder -> supportsDecoding ( $ format , $ context ) ) { $ this -> decoderByFormat [ $ format ] = $ i ; return $ decoder ; } } throw new RuntimeException ( sprintf ( 'No decoder found for format "%s".' , $ format ) ) ; }
Gets the decoder supporting the format.

@throws RuntimeException if no decoder is found
Gets the decoder supporting the format .