original_string: public function addParser(array $types, callable $parser)
      {
          foreach ($types as $type) {
              $type = strtolower($type);
              $this->parsers[$type] = $parser;
          }
  
          return $this;
      }
code: public function addParser(array $types, callable $parser)
      {
          foreach ($types as $type) {
              $type = strtolower($type);
              $this->parsers[$type] = $parser;
          }
  
          return $this;
      }
code_tokens: public function addParser ( array $ types , callable $ parser ) { foreach ( $ types as $ type ) { $ type = strtolower ( $ type ) ; $ this -> parsers [ $ type ] = $ parser ; } return $ this ; }
docstring: Add a parser.
  
  Map a set of content-type header values to be parsed by the $parser.
  
  ### Example
  
  An naive CSV request body parser could be built like so:
  
  ```
  $parser->addParser(['text/csv'], function ($body) {
  return str_getcsv($body);
  });
  ```
  
  @param array $types An array of content-type header values to match. eg. application/json
  @param callable $parser The parser function. Must return an array of data to be inserted
  into the request.
  @return $this
docstring_tokens: Add a parser .