final class UriHelper (View source)

Helper to extract information from Uris.

Methods

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

Returns the path relative to the $baseUri

static UriInterface
uriWithQueryParameters(UriInterface $uri, array $queryParameters)

Sets and replaces the query parameters.

static UriInterface
uriWithAdditionalQueryParameters(UriInterface $uri, array $queryParameters)

Merges the additional query parameters recursively into the current query parameters.

static int|null
getDefaultPortForScheme(string $scheme)

No description

Details

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 question

Return Value

string

static UriInterface uriWithQueryParameters(UriInterface $uri, array $queryParameters)

Sets and replaces the query parameters.

Parameters

UriInterface $uri
array $queryParameters

Return Value

UriInterface

A new instance with the replaced query parameters.

static UriInterface uriWithAdditionalQueryParameters(UriInterface $uri, array $queryParameters)

Merges the additional query parameters recursively into the current query parameters.

Parameters

UriInterface $uri
array $queryParameters

Return Value

UriInterface

A new instance with the additional query parameters.

static int|null getDefaultPortForScheme(string $scheme)

No description

Parameters

string $scheme

Return Value

int|null