src/HTTP2.php
protected function matchAccept($header, $supported)
    {
        $matches = $this->sortAccept($header);
        foreach ($matches as $key => $q) {
            if (isset($supported[$key])) {
                return $supported[$key];
            }
        }
        // If any (i.e. "*") is acceptable, return the first supported format
        if (isset($matches['*'])) {
            return array_shift($supported);
        }
        return null;
    }
protected function matchAccept($header, $supported)
    {
        $matches = $this->sortAccept($header);
        foreach ($matches as $key => $q) {
            if (isset($supported[$key])) {
                return $supported[$key];
            }
        }
        // If any (i.e. "*") is acceptable, return the first supported format
        if (isset($matches['*'])) {
            return array_shift($supported);
        }
        return null;
    }
Parses a weighed "Accept" HTTP header and matches it against a list
of supported options

@param string $header    The HTTP "Accept" header to parse
@param array  $supported A list of supported values

@return string|NULL a matched option, or NULL if no match