PHP Class Negotiation\AbstractNegotiator

Datei anzeigen Open project: willdurand/negotiation Class Usage Examples

Public Methods

Method Description
getBest ( string $header, array $priorities, $strict = false ) : negotiation\AcceptHeader | null

Protected Methods

Method Description
acceptFactory ( string $header ) : negotiation\AcceptHeader
match ( negotiation\AcceptHeader $header, negotiation\AcceptHeader $priority, integer $index ) : negotiation\Match | null

Private Methods

Method Description
findMatches ( array $headerParts, array $priorities ) : negotiation\Match[]
parseHeader ( string $header ) : negotiation\AcceptHeader[]

Method Details

acceptFactory() abstract protected method

abstract protected acceptFactory ( string $header ) : negotiation\AcceptHeader
$header string accept header part or server priority
return negotiation\AcceptHeader Parsed header object

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

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