Documentation

AuthorityInterface extends UriComponentInterface
in

Table of Contents

Methods

__toString()  : string
Returns the instance string representation.
components()  : array{user: ?string, pass: ?string, host: ?string, port: ?int}
Returns an associative array containing all the Authority components.
getHost()  : string|null
Returns the host component of the authority.
getPort()  : int|null
Returns the port component of the authority.
getUriComponent()  : string
Returns the instance string representation with its optional URI delimiters.
getUserInfo()  : string|null
Returns the user information component of the authority.
jsonSerialize()  : string|null
Returns the instance json representation.
toString()  : string
Returns the instance string representation.
value()  : string|null
Returns the instance string representation.
withHost()  : self
Return an instance with the specified host.
withPort()  : self
Return an instance with the specified port.
withUserInfo()  : self
Return an instance with the specified user information.

Methods

__toString()

Returns the instance string representation.

public __toString() : string

If the instance is defined, the value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986, Sections 2 and 3.

If the instance is not defined, an empty string is returned

Return values
string

components()

Returns an associative array containing all the Authority components.

public components() : array{user: ?string, pass: ?string, host: ?string, port: ?int}

The returned a hashmap similar to PHP's parse_url return value

Tags
link
https://tools.ietf.org/html/rfc3986
Return values
array{user: ?string, pass: ?string, host: ?string, port: ?int}

getHost()

Returns the host component of the authority.

public getHost() : string|null
Return values
string|null

getPort()

Returns the port component of the authority.

public getPort() : int|null
Return values
int|null

getUriComponent()

Returns the instance string representation with its optional URI delimiters.

public getUriComponent() : string

The value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986, Sections 2 and 3.

If the instance is not defined, an empty string is returned

Return values
string

getUserInfo()

Returns the user information component of the authority.

public getUserInfo() : string|null
Return values
string|null

jsonSerialize()

Returns the instance json representation.

public jsonSerialize() : string|null

If the instance is defined, the value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986 or RFC 1738.

If the instance is not defined, null is returned

Return values
string|null

toString()

Returns the instance string representation.

public toString() : string

If the instance is defined, the value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986, Sections 2 and 3.

If the instance is not defined, an empty string is returned

Return values
string

value()

Returns the instance string representation.

public value() : string|null

If the instance is defined, the value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986, Sections 2 and 3.

If the instance is not defined null is returned

Return values
string|null

withHost()

Return an instance with the specified host.

public withHost(Stringable|string|null $host) : self

This method MUST retain the state of the current instance, and return an instance that contains the specified host.

A null value provided for the host is equivalent to removing the host information.

Parameters
$host : Stringable|string|null
Tags
throws
SyntaxError

for invalid component or transformations that would result in an object in invalid state.

throws
MissingFeature

for component or transformations requiring IDN support when IDN support is not present or misconfigured.

Return values
self

withPort()

Return an instance with the specified port.

public withPort(int|null $port) : self

This method MUST retain the state of the current instance, and return an instance that contains the specified port.

A null value provided for the port is equivalent to removing the port information.

Parameters
$port : int|null
Tags
throws
SyntaxError

for invalid component or transformations that would result in an object in invalid state.

Return values
self

withUserInfo()

Return an instance with the specified user information.

public withUserInfo(Stringable|string|null $user[, Stringable|string|null $password = null ]) : self

This method MUST retain the state of the current instance, and return an instance that contains the specified user information.

Password is optional, but the user information MUST include the user; a null value for the user is equivalent to removing user information.

Parameters
$user : Stringable|string|null
$password : Stringable|string|null = null
Tags
throws
SyntaxError

for invalid component or transformations that would result in an object in invalid state.

Return values
self

        
On this page

Search results