class Trim extends StringMutator (View source)

Trims a string with specified direction and characters

Traits

Methods

__construct(StringDirection $direction = StringDirection::Both, string $characters = null)

No description

mixed
__invoke(mixed $value)

Mutate the input value.

from  Mutator
static Trim
both(string $characters = null)

No description

static Trim
left(string $characters = null)

No description

static Trim
make(StringDirection $direction = StringDirection::Both, string $characters = null)

No description

mixed
mutate(mixed $value)

Mutate the input value.

string
mutateString(string $value)

No description

string
resolveStringInput(mixed $value)

No description

static Trim
right(string $characters = null)

No description

Details

__construct(StringDirection $direction = StringDirection::Both, string $characters = null)

No description

Parameters

StringDirection $direction

The direction to trim (default: StringDirection::Both).

string $characters

The characters to trim (default: \t\n\r\0\x0B).

final mixed __invoke(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

static Trim both(string $characters = null)

No description

Parameters

string $characters

The characters to trim (default: \t\n\r\0\x0B).

Return Value

Trim

static Trim left(string $characters = null)

No description

Parameters

string $characters

The characters to trim (default: \t\n\r\0\x0B).

Return Value

Trim

static Trim make(StringDirection $direction = StringDirection::Both, string $characters = null)

No description

Parameters

StringDirection $direction

The direction to trim (default: StringDirection::Both).

string $characters

The characters to trim (default: \t\n\r\0\x0B).

Return Value

Trim

final mixed mutate(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

protected string mutateString(string $value)

No description

Parameters

string $value

Return Value

string

protected string resolveStringInput(mixed $value)

No description

Parameters

mixed $value

Return Value

string

static Trim right(string $characters = null)

No description

Parameters

string $characters

The characters to trim (default: \t\n\r\0\x0B).

Return Value

Trim