Documentation

UserInfoInterface extends UriComponentInterface
in

Table of Contents

Methods

__toString()  : string
Returns the instance string representation.
components()  : array{user: ?string, pass: ?string}
Returns an associative array containing all the User Info components.
getPass()  : string|null
Returns the pass component part.
getUriComponent()  : string
Returns the instance string representation with its optional URI delimiters.
getUser()  : string|null
Returns the user component part.
jsonSerialize()  : string|null
Returns the instance json representation.
toString()  : string
Returns the instance string representation.
value()  : string|null
Returns the instance string representation.
withPass()  : self
Returns an instance with the specified user and/or pass.
withUser()  : self
Returns an instance with the specified user and/or pass.

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 User Info components.

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

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}

getPass()

Returns the pass component part.

public getPass() : string|null
Return values
string|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

getUser()

Returns the user component part.

public getUser() : 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

withPass()

Returns an instance with the specified user and/or pass.

public withPass(Stringable|string|null $password) : self

This method MUST retain the state of the current instance, and return an instance that contains the specified password if the user is specified otherwise it returns the same instance unchanged.

An empty user is equivalent to removing the user information.

Parameters
$password : Stringable|string|null
Return values
self

withUser()

Returns an instance with the specified user and/or pass.

public withUser(Stringable|string|null $username) : self

This method MUST retain the state of the current instance, and return an instance that contains the specified new username otherwise it returns the same instance unchanged.

A variable equal to null is equivalent to removing the complete user information.

Parameters
$username : Stringable|string|null
Return values
self

        
On this page

Search results