class Helper (View source)

Methods

static stdClass|null
parseVersion(string $version)

Parse version format

static string
toAscii(string $text)

Convert string to ASCII

static string
capitalize(string $text, string $delimiter = '-', string $glue = '')

Capitalize words using hyphen or a custom delimiter.

static mixed
extract(string $path, array|stdClass $items, mixed $alternative = null)

Read array or object by path using dot

static bool
iterable(mixed $obj)

Equivalent to is_iterable from PHP-7.1.0+

static bool
seq(mixed $array)

Check if array is sequential, like ['foo', 'bar']

static bool
assoc(mixed $array)

Check if array is associative, like [ 'bar' => foo', 'baz' => 'bar']

static void
ksort(array $array, int $flags = \SORT_REGULAR)

Check if array is associative, like [ 'bar' => foo', 'baz' => 'bar']

Details

static stdClass|null parseVersion(string $version)

Parse version format

Parameters

string $version

Return Value

stdClass|null

static string toAscii(string $text)

Convert string to ASCII

Parameters

string $text

Return Value

string

static string capitalize(string $text, string $delimiter = '-', string $glue = '')

Capitalize words using hyphen or a custom delimiter.

Parameters

string $text
string $delimiter
string $glue

Return Value

string

static mixed extract(string $path, array|stdClass $items, mixed $alternative = null)

Read array or object by path using dot

Parameters

string $path
array|stdClass $items
mixed $alternative

Return Value

mixed

static bool iterable(mixed $obj)

Equivalent to is_iterable from PHP-7.1.0+

Parameters

mixed $obj

Return Value

bool

static bool seq(mixed $array)

Check if array is sequential, like ['foo', 'bar']

Parameters

mixed $array

Return Value

bool

static bool assoc(mixed $array)

Check if array is associative, like [ 'bar' => foo', 'baz' => 'bar']

Parameters

mixed $array

Return Value

bool

static void ksort(array $array, int $flags = \SORT_REGULAR)

Check if array is associative, like [ 'bar' => foo', 'baz' => 'bar']

Parameters

array $array
int $flags See details in https://www.php.net/manual/en/function.sort.php#refsect1-function.sort-parameters

Return Value

void