Documentation

UserInfoInterface extends UriComponentInterface

Table of Contents

__toString()  : string
Returns the instance string representation.
getContent()  : string|null
Returns the instance content.
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.
withContent()  : self
Returns an instance with the specified content.
withUserInfo()  : 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

getContent()

Returns the instance content.

public getContent() : string|null

If the instance is defined, the value returned MUST be encoded according to the selected encoding algorithm. In any case, the value MUST NOT double-encode any character depending on the selected encoding algorithm.

To determine what characters to encode, please refer to RFC 3986, Sections 2 and 3. or RFC 3987 Section 3. By default the content is encoded according to RFC3986

If the instance is not defined null is returned

Return values
string|null

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

withContent()

Returns an instance with the specified content.

public withContent(string|null $content) : self

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

Users can provide both encoded and decoded content characters.

A null value is equivalent to removing the component content.

Parameters
$content : string|null
Tags
throws
SyntaxError

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

throws
IdnSupportMissing

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

Return values
self

withUserInfo()

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

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

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

An empty user is equivalent to removing the user information.

Parameters
$user : string|null
$pass : string|null = null
Return values
self

Search results