MediaType
in package
implements
Stringable, IComparable, IEquatable
Table of Contents
Interfaces
- Stringable
- IComparable
- Provides an interface for comparison between objects. Allows for order/sorting instances.
- IEquatable
- Provides an interface for determining the value-equality of two objects.
Methods
- __construct() : mixed
- __toString() : string
- compare() : int
- Compares the current instance with another and returns an integer that indicates whether the current object comes before or after or the same position and the other object.
- compareCategory() : int
- compareKind() : int
- compareSuffix() : int
- equals() : bool
- Checks whether the current object is equal to another.
- fromPath() : MediaType
- getCategory() : string
- getCharset() : string
- getKind() : string
- getParam() : mixed
- getParams() : array<string|int, mixed>
- getQuality() : float
- getSuffix() : string
- hasParam() : bool
- matchCategory() : bool
- matchKind() : bool
- matchSuffix() : bool
- parse() : MediaType
Methods
__construct()
public
__construct(string $category, string $kind, string $suffix, array<string|int, mixed> $params) : mixed
Parameters
- $category : string
- $kind : string
- $suffix : string
- $params : array<string|int, mixed>
__toString()
public
__toString() : string
Return values
stringcompare()
Compares the current instance with another and returns an integer that indicates whether the current object comes before or after or the same position and the other object.
public
compare(mixed $other) : int
Parameters
- $other : mixed
Return values
int —A value that indicates the relative order of the objects being compared. Less than zero for before, zero for same position, greater than zero for after.
compareCategory()
public
compareCategory(string $category) : int
Parameters
- $category : string
Return values
intcompareKind()
public
compareKind(string $kind) : int
Parameters
- $kind : string
Return values
intcompareSuffix()
public
compareSuffix(string $suffix) : int
Parameters
- $suffix : string
Return values
intequals()
Checks whether the current object is equal to another.
public
equals(mixed $other) : bool
Parameters
- $other : mixed
Return values
bool —true if the objects are equals, false if not.
fromPath()
public
static fromPath(string $path) : MediaType
Parameters
- $path : string
Return values
MediaTypegetCategory()
public
getCategory() : string
Return values
stringgetCharset()
public
getCharset() : string
Return values
stringgetKind()
public
getKind() : string
Return values
stringgetParam()
public
getParam(string $name[, int $filter = FILTER_DEFAULT ][, mixed $options = null ]) : mixed
Parameters
- $name : string
- $filter : int = FILTER_DEFAULT
- $options : mixed = null
getParams()
public
getParams() : array<string|int, mixed>
Return values
array<string|int, mixed>getQuality()
public
getQuality() : float
Return values
floatgetSuffix()
public
getSuffix() : string
Return values
stringhasParam()
public
hasParam(string $name) : bool
Parameters
- $name : string
Return values
boolmatchCategory()
public
matchCategory(string $category) : bool
Parameters
- $category : string
Return values
boolmatchKind()
public
matchKind(string $kind) : bool
Parameters
- $kind : string
Return values
boolmatchSuffix()
public
matchSuffix(string $suffix) : bool
Parameters
- $suffix : string
Return values
boolparse()
public
static parse(string $mediaTypeStr) : MediaType
Parameters
- $mediaTypeStr : string