original_string: private function getEncoder(string $format, array $context): EncoderInterface
      {
          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, $context)) {
                  $this->encoderByFormat[$format] = $i;
  
                  return $encoder;
              }
          }
  
          throw new RuntimeException(sprintf('No encoder found for format "%s".', $format));
      }
code: private function getEncoder(string $format, array $context): EncoderInterface
      {
          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, $context)) {
                  $this->encoderByFormat[$format] = $i;
  
                  return $encoder;
              }
          }
  
          throw new RuntimeException(sprintf('No encoder found for format "%s".', $format));
      }
code_tokens: private function getEncoder ( string $ format , array $ context ) : EncoderInterface { 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 , $ context ) ) { $ this -> encoderByFormat [ $ format ] = $ i ; return $ encoder ; } } throw new RuntimeException ( sprintf ( 'No encoder found for format "%s".' , $ format ) ) ; }
docstring: Gets the encoder supporting the format.
  
  @throws RuntimeException if no encoder is found
docstring_tokens: Gets the encoder supporting the format .