Builder
in package
implements
Conditionable, Transformable
FinalYes
Table of Contents
Interfaces
Properties
- $fragment : string|null
- $host : string|null
- $password : string|null
- $path : string|null
- $port : int|null
- $query : string|null
- $scheme : string|null
- $username : string|null
Methods
- __construct() : mixed
- authority() : self
- build() : Uri
- fragment() : self
- guard() : self
- host() : self
- path() : self
- port() : self
- query() : self
- reset() : self
- Puts back the Builder in a freshly created state.
- scheme() : self
- transform() : static
- Executes the given callback with the current instance and returns the current instance.
- userInfo() : static
- validate() : bool
- Tells whether the URI can be built with the current Builder state.
- when() : static
- Apply the callback if the given "condition" is (or resolves to) true.
- buildAuthority() : string|null
- buildPath() : string|null
- filterString() : string|null
- Filter a string.
Properties
$fragment
private
string|null
$fragment
= null
$host
private
string|null
$host
= null
$password
private
string|null
$password
= null
$path
private
string|null
$path
= null
$port
private
int|null
$port
= null
$query
private
string|null
$query
= null
$scheme
private
string|null
$scheme
= null
$username
private
string|null
$username
= null
Methods
__construct()
public
__construct([BackedEnum|Stringable|string|null $scheme = null ][, BackedEnum|Stringable|string|null $username = null ][, BackedEnum|Stringable|string|null $password = null ][, BackedEnum|Stringable|string|null $host = null ][, BackedEnum|int|null $port = null ][, BackedEnum|Stringable|string|null $path = null ][, BackedEnum|Stringable|string|null $query = null ][, BackedEnum|Stringable|string|null $fragment = null ]) : mixed
Parameters
- $scheme : BackedEnum|Stringable|string|null = null
- $username : BackedEnum|Stringable|string|null = null
- $password : BackedEnum|Stringable|string|null = null
- $host : BackedEnum|Stringable|string|null = null
- $port : BackedEnum|int|null = null
- $path : BackedEnum|Stringable|string|null = null
- $query : BackedEnum|Stringable|string|null = null
- $fragment : BackedEnum|Stringable|string|null = null
authority()
public
authority(BackedEnum|Stringable|string|null $authority) : self
Parameters
- $authority : BackedEnum|Stringable|string|null
Tags
Return values
selfbuild()
public
build([Uri|Url|BackedEnum|Stringable|string|null $baseUri = null ]) : Uri
Parameters
- $baseUri : Uri|Url|BackedEnum|Stringable|string|null = null
Return values
Urifragment()
public
fragment(BackedEnum|Stringable|string|null $fragment) : self
Parameters
- $fragment : BackedEnum|Stringable|string|null
Tags
Return values
selfguard()
public
guard([Uri|Url|BackedEnum|Stringable|string|null $baseUri = null ]) : self
Parameters
- $baseUri : Uri|Url|BackedEnum|Stringable|string|null = null
Tags
Return values
selfhost()
public
host(BackedEnum|Stringable|string|null $host) : self
Parameters
- $host : BackedEnum|Stringable|string|null
Tags
Return values
selfpath()
public
path(BackedEnum|Stringable|string|null $path) : self
Parameters
- $path : BackedEnum|Stringable|string|null
Tags
Return values
selfport()
public
port(BackedEnum|int|null $port) : self
Parameters
- $port : BackedEnum|int|null
Tags
Return values
selfquery()
public
query(BackedEnum|Stringable|string|null $query) : self
Parameters
- $query : BackedEnum|Stringable|string|null
Tags
Return values
selfreset()
Puts back the Builder in a freshly created state.
public
reset() : self
Return values
selfscheme()
public
scheme(BackedEnum|Stringable|string|null $scheme) : self
Parameters
- $scheme : BackedEnum|Stringable|string|null
Tags
Return values
selftransform()
Executes the given callback with the current instance and returns the current instance.
public
transform(callable(self): self $callback) : static
Parameters
- $callback : callable(self): self
Return values
staticuserInfo()
public
userInfo(BackedEnum|Stringable|string|null $user[, BackedEnum|Stringable|string|null $password = null ]) : static
Parameters
- $user : BackedEnum|Stringable|string|null
- $password : BackedEnum|Stringable|string|null = null
Tags
Return values
staticvalidate()
Tells whether the URI can be built with the current Builder state.
public
validate([Uri|Url|BackedEnum|Stringable|string|null $baseUri = null ]) : bool
Parameters
- $baseUri : Uri|Url|BackedEnum|Stringable|string|null = null
Return values
boolwhen()
Apply the callback if the given "condition" is (or resolves to) true.
public
when(callable|bool $condition, callable $onSuccess[, callable|null $onFail = null ]) : static
Parameters
- $condition : callable|bool
- $onSuccess : callable
- $onFail : callable|null = null
Return values
staticbuildAuthority()
private
buildAuthority() : string|null
Tags
Return values
string|nullbuildPath()
private
buildPath(string|null $authority) : string|null
Parameters
- $authority : string|null
Tags
Return values
string|nullfilterString()
Filter a string.
private
filterString(BackedEnum|Stringable|string|null $str) : string|null
Parameters
- $str : BackedEnum|Stringable|string|null