getBest() public method

public getBest ( string $header, array $priorities, $strict = false ) : negotiation\AcceptHeader | null
$header string A string containing an `Accept|Accept-*` header.
$priorities array A set of server priorities.
return negotiation\AcceptHeader | null best matching type
 /**
  * Returns the best value of a header.
  *
  * @param string             $accept     The header to negotiate
  * @param AbstractNegotiator $negotiator
  * @param array              $priorities
  *
  * @return string|null
  */
 private function negotiateHeader($accept, AbstractNegotiator $negotiator, array $priorities)
 {
     if (empty($accept) || empty($priorities)) {
         return;
     }
     try {
         $best = $negotiator->getBest($accept, $priorities);
     } catch (\Exception $exception) {
         return;
     }
     if ($best) {
         return $best->getValue();
     }
 }