abstract class UriHelper (View source)

Helper to extract information from Uris.

Methods

static string
getUsername(UriInterface $uri)

Get the username component of the given Uri

static string
getPassword(UriInterface $uri)

Get the password component of the given Uri

static string
getRelativePath(UriInterface $baseUri, UriInterface $uri)

Returns the path relative to the $baseUri

static array
parseQueryIntoArguments(UriInterface $uri)

Parses the URIs query string into an array of arguments

static UriInterface
uriWithArguments(UriInterface $uri, array $arguments)

Returns an Uri object with the query string being generated from the array of arguments given

static int|null
getDefaultPortForScheme(string $scheme)

No description

Details

static string getUsername(UriInterface $uri)

Get the username component of the given Uri

Parameters

UriInterface $uri

Return Value

string

If the URI had no username an empty string is returned.

static string getPassword(UriInterface $uri)

Get the password component of the given Uri

Parameters

UriInterface $uri

Return Value

string

If the URI had no password an empty string is returned.

static string getRelativePath(UriInterface $baseUri, UriInterface $uri)

Returns the path relative to the $baseUri

Parameters

UriInterface $baseUri

The base URI to start from

UriInterface $uri

The URI in quesiton

Return Value

string

static array parseQueryIntoArguments(UriInterface $uri)

Parses the URIs query string into an array of arguments

Parameters

UriInterface $uri

Return Value

array

static UriInterface uriWithArguments(UriInterface $uri, array $arguments)

Returns an Uri object with the query string being generated from the array of arguments given

Parameters

UriInterface $uri
array $arguments

Return Value

UriInterface

static int|null getDefaultPortForScheme(string $scheme)

No description

Parameters

string $scheme

Return Value

int|null