Negotiation\AbstractNegotiator::match PHP Method

match() protected method

protected match ( negotiation\AcceptHeader $header, negotiation\AcceptHeader $priority, integer $index ) : negotiation\Match | null
$header negotiation\AcceptHeader
$priority negotiation\AcceptHeader
$index integer
return negotiation\Match | null Headers matched
    protected function match(AcceptHeader $header, AcceptHeader $priority, $index)
    {
        $ac = $header->getType();
        $pc = $priority->getType();
        $equal = !strcasecmp($ac, $pc);
        if ($equal || $ac === '*') {
            $score = 1 * $equal;
            return new Match($header->getQuality() * $priority->getQuality(), $score, $index);
        }
        return null;
    }