Methods |
public
static
|
parse<T is PHP_URL_SCHEME|PHP_URL_HOST|PHP_URL_PORT|PHP_URL_USER|PHP_URL_PASS|PHP_URL_PATH|PHP_URL_QUERY|PHP_URL_FRAGMENT|-1|null>(
string $uri,
T $component = null,
): (T is -1|null ? array{scheme?: string, host?: string, port?: int, user?: string, pass?: string, path?: string, query?: string, fragment?: string}|false : (T is PHP_URL_PORT ? int|null|false : string|null|false))
Parse a URI into its components
Parse a URI into its components
This method should be used instead of {@see parse_url()} in scenarios
where using multiple URI parsers could introduce inconsistent behaviour
or security vulnerabilities.
Implemented by
|
#
|
public
|
toParts(
): array{scheme?: string, host?: string, port?: int, user?: string, pass?: string, path?: string, query?: string, fragment?: string}
Get the URI as an array of components
Get the URI as an array of components
Components not present in the URI are not returned.
Implemented by
|
#
|
public
|
isReference(): bool
Check if the URI is a relative reference
Check if the URI is a relative reference
Implemented by
|
#
|
public
|
normalise(): static
Get a normalised instance
Get a normalised instance
Removes "/./" and "/../" segments from the path. [RFC3986]-compliant
scheme- and protocol-based normalisation may also be performed.
Scheme, host and percent-encoded octets in the URI are not normalised by
this method because they are always normalised.
Implemented by
|
#
|
public
|
follow(UriInterface|Stringable|string $reference): static
Resolve a URI reference to a target URI with the instance as its base URI
Resolve a URI reference to a target URI with the instance as its base URI
Implements [RFC3986] Section 5.2.2 ("Transform References").
Implemented by
|
#
|
public
|
jsonSerialize(): string
Get the string representation of the URI
Get the string representation of the URI
|
#
|