Uri
final class Uri (View source)
Methods
Retrieve the normalized scheme component
Retrieve the raw scheme component
Modify the scheme component
Retrieve the normalized userinfo component
Retrieve the raw userinfo component
Modify the userinfo component
Retrieve the normalized username
Retrieve the raw username
Retrieve the normalized password
Retrieve the raw password
Retrieve the normalized host component
Retrieve the raw host component
Retrieve the normalized port component
Retrieve the normalized path component
Retrieve the raw path component
Retrieve the normalized query component
Retrieve the raw query component
Retrieve the normalized fragment component
Retrieve the raw fragment component
Modify the fragment component
Recompose the normalized URI
Recompose the raw URI
Serialize the Uri object
Deserialize the data parameter into a Uri object
Return the internal state of the URI
No description
No description
Details
__construct(string $uri, Uri|null $baseUrl = null)
Construct the Uri object
Constructs the Uri\Rfc3986\Uri object.
string|null
getScheme()
Retrieve the normalized scheme component
Retrieves the normalized scheme component.
string|null
getRawScheme()
Retrieve the raw scheme component
Retrieves the raw (non-normalized) scheme component.
Uri
withScheme(string|null $scheme)
Modify the scheme component
Creates a new URI and modifies its scheme component.
string|null
getUserInfo()
Retrieve the normalized userinfo component
Retrieves the normalized userinfo component.
string|null
getRawUserInfo()
Retrieve the raw userinfo component
Retrieves the raw (non-normalized) userinfo component.
Uri
withUserInfo(string|null $userinfo)
Modify the userinfo component
Creates a new URI and modifies its userinfo component.
string|null
getUsername()
Retrieve the normalized username
Retrieves the normalized username part (the text before the first : character) from the userinfo component.
string|null
getRawUsername()
Retrieve the raw username
Retrieves the raw (non-normalized) username part (the text before the first : character) from userinfo component.
string|null
getPassword()
Retrieve the normalized password
Retrieves the normalized password part (the text after the first : character) from the userinfo component.
string|null
getRawPassword()
Retrieve the raw password
Retrieves the raw (non-normalized) password part (the text after the first : character) from the userinfo component.
string|null
getHost()
Retrieve the normalized host component
Retrieves the normalized host component.
string|null
getRawHost()
Retrieve the raw host component
Retrieves the raw (non-normalized) host component.
Uri
withHost(string|null $host)
Modify the host component
Creates a new URI and modifies its host component.
int|null
getPort()
Retrieve the normalized port component
Retrieves the normalized port component.
Uri
withPort(int|null $port)
Modify the port component
Creates a new URI and modifies its port component.
string
getPath()
Retrieve the normalized path component
Retrieves the normalized path component.
string
getRawPath()
Retrieve the raw path component
Retrieves the raw (non-normalized) path component.
Uri
withPath(string $path)
Modify the path component
Creates a new URI and modifies its path component.
string|null
getQuery()
Retrieve the normalized query component
Retrieves the normalized query component.
string|null
getRawQuery()
Retrieve the raw query component
Retrieves the raw (non-normalized) query component.
Uri
withQuery(string|null $query)
Modify the query component
Creates a new URI and modifies its query component.
string|null
getFragment()
Retrieve the normalized fragment component
Retrieves the normalized fragment component.
string|null
getRawFragment()
Retrieve the raw fragment component
Retrieves the raw (non-normalized) fragment component.
Uri
withFragment(string|null $fragment)
Modify the fragment component
Creates a new URI and modifies its fragment component.
bool
equals(Uri $uri, UriComparisonMode $comparisonMode = \Uri\UriComparisonMode::ExcludeFragment)
Check if two URIs are equivalent
Checks if two URIs are equivalent.
string
toString()
Recompose the normalized URI
Recomposes the normalized URI to a string.
string
toRawString()
Recompose the raw URI
Recomposes the raw (non-normalized) URI to a string.
Uri
resolve(string $uri)
Resolve a URI with the current object as the base URL
Resolves a URI - which may potentially be a relative reference - with the current object as the base URL.
array
__serialize()
Serialize the Uri object
Serializes the Uri\Rfc3986\Uri object.
void
__unserialize(array $data)
Deserialize the data parameter into a Uri object
Deserializes a data parameter into a Uri\Rfc3986\Uri object.
array
__debugInfo()
Return the internal state of the URI
Returns the internal state of the URI.
UriHostType|null
getHostType()
No description
UriType|null
getUriType()
No description