class Str (View source)

Methods

static string
list(array $list)

Make a list with literals or nested lists.

static array|string
literal(array|string $string)

Make one or more literals.

static array|string|null
enums(BackedEnum|array|string|null $enums = null)

Resolve the value of the given enums.

static string
enum(BackedEnum|string $enum)

Resolve the value of the given enum.

static string
set(int|string|array $from, int|float|string|null $to = null)

Make a range set for use in a search command.

static string
credentials(string $user, string $token)

Make a credentials string for use in the AUTHENTICATE command.

static string
prefix(string $value, string $prefix)

Prefix a string with the given prefix if it does not already start with it.

static string
escape(string $string)

Escape a string for use in a list.

static string
fromImapUtf7(string $string)

Decode a modified UTF-7 string (IMAP specific) to UTF-8.

static string
toImapUtf7(string $string)

Encode a UTF-8 string to modified UTF-7 (IMAP specific).

static 
is(array|string $pattern, string $value, bool $ignoreCase = false)

Determine if a given string matches a given pattern.

Details

static string list(array $list)

Make a list with literals or nested lists.

Parameters

array $list

Return Value

string

static array|string literal(array|string $string)

Make one or more literals.

Parameters

array|string $string

Return Value

array|string

static array|string|null enums(BackedEnum|array|string|null $enums = null)

Resolve the value of the given enums.

Parameters

BackedEnum|array|string|null $enums

Return Value

array|string|null

static string enum(BackedEnum|string $enum)

Resolve the value of the given enum.

Parameters

BackedEnum|string $enum

Return Value

string

static string set(int|string|array $from, int|float|string|null $to = null)

Make a range set for use in a search command.

Parameters

int|string|array $from
int|float|string|null $to

Return Value

string

static string credentials(string $user, string $token)

Make a credentials string for use in the AUTHENTICATE command.

Parameters

string $user
string $token

Return Value

string

static string prefix(string $value, string $prefix)

Prefix a string with the given prefix if it does not already start with it.

Parameters

string $value
string $prefix

Return Value

string

static string escape(string $string)

Escape a string for use in a list.

Parameters

string $string

Return Value

string

static string fromImapUtf7(string $string)

Decode a modified UTF-7 string (IMAP specific) to UTF-8.

Parameters

string $string

Return Value

string

static string toImapUtf7(string $string)

Encode a UTF-8 string to modified UTF-7 (IMAP specific).

Parameters

string $string

Return Value

string

static is(array|string $pattern, string $value, bool $ignoreCase = false)

Determine if a given string matches a given pattern.

Parameters

array|string $pattern
string $value
bool $ignoreCase