Documentation

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

__construct()

private __construct() : mixed
Tags
codeCoverageIgnore
Return values
mixed

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
throws
TypeError

if the URI object does not implements the supported interfaces.

Return values
UriInterface|UriInterface

Search results