UriInfo
in package
Table of Contents
- REGEXP_ENCODED_CHARS = ',%(2[D|E]|3[0-9]|4[1-9|A-F]|5[0-9|AF]|6[1-9|A-F]|7[0-9|E]),i'
- WHATWG_SPECIAL_SCHEMES = ['ftp' => 21, 'http' => 80, 'https' => 443, 'ws' => 80, 'wss' => 443]
- getOrigin() : string|null
- Returns the URI origin property as defined by WHATWG URL living standard.
- isAbsolute() : bool
- Tell whether the URI represents an absolute URI.
- isAbsolutePath() : bool
- Tell whether the URI represents an absolute path.
- isCrossOrigin() : bool
- isNetworkPath() : bool
- Tell whether the URI represents a network path.
- isRelativePath() : bool
- Tell whether the URI represents a relative path.
- isSameDocument() : bool
- Tell whether both URI refers to the same document.
- __construct() : mixed
- emptyComponentValue() : string|null
- filterUri() : UriInterface|UriInterface
- Filter the URI object.
- normalize() : UriInterface|UriInterface
- Normalize an URI for comparison.
Constants
REGEXP_ENCODED_CHARS
private
mixed
REGEXP_ENCODED_CHARS
= ',%(2[D|E]|3[0-9]|4[1-9|A-F]|5[0-9|AF]|6[1-9|A-F]|7[0-9|E]),i'
WHATWG_SPECIAL_SCHEMES
private
mixed
WHATWG_SPECIAL_SCHEMES
= ['ftp' => 21, 'http' => 80, 'https' => 443, 'ws' => 80, 'wss' => 443]
Methods
getOrigin()
Returns the URI origin property as defined by WHATWG URL living standard.
public
static getOrigin(UriInterface|UriInterface $uri) : string|null
https://url.spec.whatwg.org/#origin
For URI without a special scheme the method returns null For URI with the file scheme the method will return null (as this is left to the implementation decision) For URI with a special scheme the method returns the scheme followed by its authority (without the userinfo part)
Parameters
- $uri : UriInterface|UriInterface
Return values
string|null —isAbsolute()
Tell whether the URI represents an absolute URI.
public
static isAbsolute(UriInterface|UriInterface $uri) : bool
Parameters
- $uri : UriInterface|UriInterface
Return values
bool —isAbsolutePath()
Tell whether the URI represents an absolute path.
public
static isAbsolutePath(UriInterface|UriInterface $uri) : bool
Parameters
- $uri : UriInterface|UriInterface
Return values
bool —isCrossOrigin()
public
static isCrossOrigin(UriInterface|UriInterface $uri, UriInterface|UriInterface $base_uri) : bool
Parameters
- $uri : UriInterface|UriInterface
- $base_uri : UriInterface|UriInterface
Return values
bool —isNetworkPath()
Tell whether the URI represents a network path.
public
static isNetworkPath(UriInterface|UriInterface $uri) : bool
Parameters
- $uri : UriInterface|UriInterface
Return values
bool —isRelativePath()
Tell whether the URI represents a relative path.
public
static isRelativePath(UriInterface|UriInterface $uri) : bool
Parameters
- $uri : UriInterface|UriInterface
Return values
bool —isSameDocument()
Tell whether both URI refers to the same document.
public
static isSameDocument(UriInterface|UriInterface $uri, UriInterface|UriInterface $base_uri) : bool
Parameters
- $uri : UriInterface|UriInterface
- $base_uri : UriInterface|UriInterface
Return values
bool —__construct()
private
__construct() : mixed
Tags
Return values
mixed —emptyComponentValue()
private
static emptyComponentValue(UriInterface|UriInterface $uri) : string|null
Parameters
- $uri : UriInterface|UriInterface
Return values
string|null —filterUri()
Filter the URI object.
private
static filterUri(mixed $uri) : UriInterface|UriInterface
To be valid an URI MUST implement at least one of the following interface:
- League\Uri\UriInterface
- Psr\Http\Message\UriInterface
Parameters
- $uri : mixed
-
the URI to validate
Tags
Return values
UriInterface|UriInterface —normalize()
Normalize an URI for comparison.
private
static normalize(UriInterface|UriInterface $uri) : UriInterface|UriInterface
Parameters
- $uri : UriInterface|UriInterface