PHP Class Neomerx\JsonApi\Http\Headers\AcceptHeader

Inheritance: extends Header, implements Neomerx\JsonApi\Contracts\Http\Headers\AcceptHeaderInterface
Datei anzeigen Open project: neomerx/json-api Class Usage Examples

Public Methods

Method Description
__construct ( Neomerx\JsonApi\Contracts\Http\Headers\AcceptMediaTypeInterface[] $unsortedMediaTypes )
parse ( $header, $accept = self::HEADER_ACCEPT ) : Neomerx\JsonApi\Contracts\Http\Headers\AcceptHeaderInterface

Protected Methods

Method Description
newInstance ( $name, $mediaTypes ) : Neomerx\JsonApi\Contracts\Http\Headers\AcceptHeaderInterface
parseMediaType ( $position, $mediaType ) : Neomerx\JsonApi\Contracts\Http\Headers\AcceptMediaTypeInterface

Private Methods

Method Description
compareParameters ( array | null $lhs, array | null $rhs ) : integer
compareQuality ( float $lhs, float $rhs ) : integer
compareStrings ( string $lhs, string $rhs ) : integer
getMediaTypeCompareClosure ( ) : Closure

Method Details

__construct() public method

public __construct ( Neomerx\JsonApi\Contracts\Http\Headers\AcceptMediaTypeInterface[] $unsortedMediaTypes )
$unsortedMediaTypes Neomerx\JsonApi\Contracts\Http\Headers\AcceptMediaTypeInterface[]

newInstance() protected static method

protected static newInstance ( $name, $mediaTypes ) : Neomerx\JsonApi\Contracts\Http\Headers\AcceptHeaderInterface
return Neomerx\JsonApi\Contracts\Http\Headers\AcceptHeaderInterface

parse() public static method

public static parse ( $header, $accept = self::HEADER_ACCEPT ) : Neomerx\JsonApi\Contracts\Http\Headers\AcceptHeaderInterface
return Neomerx\JsonApi\Contracts\Http\Headers\AcceptHeaderInterface

parseMediaType() protected static method

protected static parseMediaType ( $position, $mediaType ) : Neomerx\JsonApi\Contracts\Http\Headers\AcceptMediaTypeInterface
return Neomerx\JsonApi\Contracts\Http\Headers\AcceptMediaTypeInterface