Uri
in package
implements
UriInterface
Implements an URI object
Tags
Table of Contents
Interfaces
- UriInterface
Constants
- CHAR_GEN_DELIMS = ':\/\?#\[\]@'
- Generic delimiters for use in a regex.
- CHAR_PERCENT_HEX = '%(?![a-fA-F0-9]{2})'
- Percent encoded
- CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='
- Sub delimiters for use in a regex.
- CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~'
- Unreserved characters for use in a regex.
Properties
- $fragment : string
- $host : string
- $pass : string
- $path : string
- $port : int|null
- $query : string
- $scheme : string
- $user : string
Methods
- __construct() : mixed
- Uri constructor.
- __toString() : string
- getAuthority() : string
- getFragment() : string
- getHost() : string
- getPath() : string
- getPort() : int|null
- getQuery() : string
- getScheme() : string
- getUserInfo() : string
- withFragment() : static
- withHost() : static
- withPath() : static
- withPort() : static
- withQuery() : static
- withScheme() : static
- withUserInfo() : static
- filterHost() : string
- filterPath() : string
- filterPort() : int|null
- filterQueryOrFragment() : string
- filterScheme() : string
- filterUserInfo() : string
- parseUriParts() : static
- replaceChars() : string
Constants
CHAR_GEN_DELIMS
Generic delimiters for use in a regex.
protected
mixed
CHAR_GEN_DELIMS
= ':\/\?#\[\]@'
Tags
CHAR_PERCENT_HEX
Percent encoded
protected
mixed
CHAR_PERCENT_HEX
= '%(?![a-fA-F0-9]{2})'
Tags
CHAR_SUB_DELIMS
Sub delimiters for use in a regex.
protected
mixed
CHAR_SUB_DELIMS
= '!\$&\'\(\)\*\+,;='
Tags
CHAR_UNRESERVED
Unreserved characters for use in a regex.
protected
mixed
CHAR_UNRESERVED
= 'a-zA-Z0-9_\-\.~'
Tags
Properties
$fragment
protected
string
$fragment
= ''
$host
protected
string
$host
= ''
$pass
protected
string
$pass
= ''
$path
protected
string
$path
= ''
$port
protected
int|null
$port
= null
$query
protected
string
$query
= ''
$scheme
protected
string
$scheme
= ''
$user
protected
string
$user
= ''
Methods
__construct()
Uri constructor.
public
__construct([array<string|int, mixed>|string|null $uri = null ]) : mixed
Parameters
- $uri : array<string|int, mixed>|string|null = null
Tags
__toString()
public
__toString() : string
Tags
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
stringgetScheme()
public
getScheme() : string
Return values
stringgetUserInfo()
public
getUserInfo() : string
Return values
stringwithFragment()
public
withFragment(string $fragment) : static
Parameters
- $fragment : string
Return values
staticwithHost()
public
withHost(string $host) : static
Parameters
- $host : string
Return values
staticwithPath()
public
withPath(string $path) : static
Parameters
- $path : string
Return values
staticwithPort()
public
withPort(int|null $port) : static
Parameters
- $port : int|null
Return values
staticwithQuery()
public
withQuery(string $query) : static
Parameters
- $query : string
Return values
staticwithScheme()
public
withScheme(string $scheme) : static
Parameters
- $scheme : string
Return values
staticwithUserInfo()
public
withUserInfo(string $user[, string|null $password = null ]) : static
Parameters
- $user : string
- $password : string|null = null
Return values
staticfilterHost()
protected
filterHost(string $host) : string
Parameters
- $host : string
Return values
stringfilterPath()
protected
filterPath(string $path) : string
Parameters
- $path : string
Return values
stringfilterPort()
protected
filterPort(int|null $port) : int|null
Parameters
- $port : int|null
Tags
Return values
int|nullfilterQueryOrFragment()
protected
filterQueryOrFragment(string $queryOrFragment) : string
Parameters
- $queryOrFragment : string
Return values
stringfilterScheme()
protected
filterScheme(string $scheme) : string
Parameters
- $scheme : string
Tags
Return values
stringfilterUserInfo()
protected
filterUserInfo(string $userOrPass) : string
Parameters
- $userOrPass : string
Return values
stringparseUriParts()
protected
parseUriParts(array<string|int, mixed> $parts) : static
Parameters
- $parts : array<string|int, mixed>
Tags
Return values
staticreplaceChars()
protected
replaceChars(string $str, string $regex) : string
Parameters
- $str : string
- $regex : string