original_string: public function negotiate($content, MediaTypeList $mediaTypeList)
      {
          $contentType = $mediaTypeList->getBestMatch(array_keys($this->supportedMediaTypes));
          if (!$contentType) {
              throw new Exception('A suitable Content-Type could not be found.');
          }
  
          $result = new NegotiatedResult();
          $result->contentType = $contentType;
          $result->content = $this->encode($content, $contentType);
  
          return $result;
      }
code: public function negotiate($content, MediaTypeList $mediaTypeList)
      {
          $contentType = $mediaTypeList->getBestMatch(array_keys($this->supportedMediaTypes));
          if (!$contentType) {
              throw new Exception('A suitable Content-Type could not be found.');
          }
  
          $result = new NegotiatedResult();
          $result->contentType = $contentType;
          $result->content = $this->encode($content, $contentType);
  
          return $result;
      }
code_tokens: public function negotiate ( $ content , MediaTypeList $ mediaTypeList ) { $ contentType = $ mediaTypeList -> getBestMatch ( array_keys ( $ this -> supportedMediaTypes ) ) ; if ( ! $ contentType ) { throw new Exception ( 'A suitable Content-Type could not be found.' ) ; } $ result = new NegotiatedResult ( ) ; $ result -> contentType = $ contentType ; $ result -> content = $ this -> encode ( $ content , $ contentType ) ; return $ result ; }
docstring: Negotiates content based on a set of input criteria.
  
  @param mixed                                      $content
  @param \BedRest\Content\Negotiation\MediaTypeList $mediaTypeList
  
  @throws \BedRest\Content\Negotiation\Exception
  @return \BedRest\Content\Negotiation\NegotiatedResult
docstring_tokens: Negotiates content based on a set of input criteria .