Documentation

Builder
in package
implements Conditionable, Transformable

FinalYes

Table of Contents

Interfaces

Conditionable
Transformable

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

$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

build()

public build([Uri|Url|BackedEnum|Stringable|string|null $baseUri = null ]) : Uri
Parameters
$baseUri : Uri|Url|BackedEnum|Stringable|string|null = null
Return values
Uri

guard()

public guard([Uri|Url|BackedEnum|Stringable|string|null $baseUri = null ]) : self
Parameters
$baseUri : Uri|Url|BackedEnum|Stringable|string|null = null
Tags
throws
SyntaxError

if the URI can not be build with the current Builder state

Return values
self

port()

public port(BackedEnum|int|null $port) : self
Parameters
$port : BackedEnum|int|null
Tags
throws
SyntaxError
throws
TypeError
Return values
self

reset()

Puts back the Builder in a freshly created state.

public reset() : self
Return values
self

transform()

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
static

validate()

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
bool

when()

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
static

buildAuthority()

private buildAuthority() : string|null
Tags
throws
SyntaxError
Return values
string|null

buildPath()

private buildPath(string|null $authority) : string|null
Parameters
$authority : string|null
Tags
throws
SyntaxError
Return values
string|null

filterString()

Filter a string.

private filterString(BackedEnum|Stringable|string|null $str) : string|null
Parameters
$str : BackedEnum|Stringable|string|null
Tags
throws
SyntaxError

if the submitted data cannot be converted to string

Return values
string|null

        
On this page

Search results