class Bracket implements Stringable (View source)

Bracket type is for processing from database bracket field.

Methods

string|int
left()

Get the first element of the array.

string|int
right()

Get the second element of the array.

string|int
to(string|null $default = null)

Get a value or default value.

string|int
escape()

Get an escaped value.

string
array()

Get an array of values.

string
__toString()

Class magic method to get the instance information for a Exception

static Bracket
of(string|null $value)

Create a instance.

Details

string|int left()

Get the first element of the array.

Return Value

string|int

This method returns the first element of the array.

string|int right()

Get the second element of the array.

Return Value

string|int

This method returns the second element of the array.

string|int to(string|null $default = null)

Get a value or default value.

Parameters

string|null $default

Default value.

Return Value

string|int

The method returns the value or default value.

string|int escape()

Get an escaped value.

Return Value

string|int

The method returns the escaped value.

string array()

Get an array of values.

Return Value

string

This method returns an array of values.

string __toString()

Class magic method to get the instance information for a Exception

Return Value

string

The method returns the instance information for a Exception

static Bracket of(string|null $value)

Create a instance.

Parameters

string|null $value

Return Value

Bracket

The method returns the new instance.

Examples

echo Bracket::of('int unsigned')
echo Bracket::of('int unsigned')->left
echo Bracket::of('int unsigned')->right