Uri
in package
implements
UriInterface
uses
UriDecorationTrait
Class Uri
Table of Contents
Interfaces
- UriInterface
Properties
- $uri : UriInterface
Methods
- __construct() : mixed
- __toString() : string
- getAuthority() : string
- getFragment() : string
- getHost() : string
- getPath() : string
- getPort() : int|null
- getQuery() : string
- getQueryParams() : array<string|int, mixed>
- getScheme() : string
- getUserInfo() : string
- isAbsolute() : bool
- Whether the URI is absolute, i.e. it has a scheme.
- isAbsolutePathReference() : bool
- Whether the URI is a absolute-path reference.
- isDefaultPort() : bool
- Whether the URI has the default port of the current scheme.
- isNetworkPathReference() : bool
- Whether the URI is a network-path reference.
- isRelativePathReference() : bool
- Whether the URI is a relative-path reference.
- isSameDocumentReference() : bool
- Whether the URI is a same-document reference.
- withFragment() : UriInterface
- withHost() : UriInterface
- withPath() : UriInterface
- withPort() : UriInterface
- withQuery() : UriInterface
- withQueryParams() : UriInterface
- withScheme() : UriInterface
- withUserInfo() : UriInterface
Properties
$uri
protected
UriInterface
$uri
Methods
__construct()
public
__construct([string $uri = '' ]) : mixed
Parameters
- $uri : string = ''
__toString()
public
__toString() : string
Return values
stringgetAuthority()
public
getAuthority() : string
Return values
stringgetFragment()
public
getFragment() : string
Return values
stringgetHost()
public
getHost() : string
Return values
stringgetPath()
public
getPath() : string
Return values
stringgetPort()
public
getPort() : int|null
Return values
int|nullgetQuery()
public
getQuery() : string
Return values
stringgetQueryParams()
public
getQueryParams() : array<string|int, mixed>
Return values
array<string|int, mixed>getScheme()
public
getScheme() : string
Return values
stringgetUserInfo()
public
getUserInfo() : string
Return values
stringisAbsolute()
Whether the URI is absolute, i.e. it has a scheme.
public
isAbsolute() : bool
An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI, the base URI. Relative references can be divided into several forms:
- network-path references, e.g. '//example.com/path'
- absolute-path references, e.g. '/path'
- relative-path references, e.g. 'subpath'
Tags
Return values
boolisAbsolutePathReference()
Whether the URI is a absolute-path reference.
public
isAbsolutePathReference() : bool
A relative reference that begins with a single slash character is termed an absolute-path reference.
Tags
Return values
boolisDefaultPort()
Whether the URI has the default port of the current scheme.
public
isDefaultPort() : bool
$uri->getPort() may return the standard port. This method can be used for some non-http/https Uri.
Return values
boolisNetworkPathReference()
Whether the URI is a network-path reference.
public
isNetworkPathReference() : bool
A relative reference that begins with two slash characters is termed an network-path reference.
Tags
Return values
boolisRelativePathReference()
Whether the URI is a relative-path reference.
public
isRelativePathReference() : bool
A relative reference that does not begin with a slash character is termed a relative-path reference.
Tags
Return values
boolisSameDocumentReference()
Whether the URI is a same-document reference.
public
isSameDocumentReference([UriInterface|null $base = null ]) : bool
A same-document reference refers to a URI that is, aside from its fragment component, identical to the base URI. When no base URI is given, only an empty URI reference (apart from its fragment) is considered a same-document reference.
Parameters
- $base : UriInterface|null = null
-
An optional base URI to compare against
Tags
Return values
boolwithFragment()
public
withFragment(string $fragment) : UriInterface
Parameters
- $fragment : string
Return values
UriInterfacewithHost()
public
withHost(string $host) : UriInterface
Parameters
- $host : string
Return values
UriInterfacewithPath()
public
withPath(string $path) : UriInterface
Parameters
- $path : string
Return values
UriInterfacewithPort()
public
withPort(int|null $port) : UriInterface
Parameters
- $port : int|null
Return values
UriInterfacewithQuery()
public
withQuery(string $query) : UriInterface
Parameters
- $query : string
Return values
UriInterfacewithQueryParams()
public
withQueryParams(array<string|int, mixed> $params) : UriInterface
Parameters
- $params : array<string|int, mixed>
Return values
UriInterfacewithScheme()
public
withScheme(string $scheme) : UriInterface
Parameters
- $scheme : string
Return values
UriInterfacewithUserInfo()
public
withUserInfo(string $user[, string|null $password = null ]) : UriInterface
Parameters
- $user : string
- $password : string|null = null