Methods |
public
static
|
list(mixed[]|null $list, string $format = "- %s\n", int $indent = 2, string|null $trim = null): string
Format values in a list
Parameters
$format |
Passed to {@see sprintf()} with each value.
|
$indent |
Spaces to add after newlines in values.
|
$trim |
Characters to trim from the end of the result,
or null to trim nothing.
|
|
#
|
public
static
|
array(mixed[]|null $array, string $format = "%s: %s\n", int $indent = 4, string|null $trim = null): string
Format keys and values in an array
Format keys and values in an array
Parameters
$format |
Passed to {@see sprintf()} with each key and value.
|
$indent |
Spaces to add after newlines in values.
|
$trim |
Characters to trim from the end of the result,
or null to trim nothing.
|
|
#
|
public
static
|
value(mixed $value): string
Format a value
|
#
|
public
static
|
bool(?bool $value): string
Format a boolean as "true" or "false"
Format a boolean as "true" or "false"
|
#
|
public
static
|
yn(?bool $value): string
Format a boolean as "yes" or "no"
Format a boolean as "yes" or "no"
|
#
|
public
static
|
date(?DateTimeInterface $date, string $before = '[', ?string $after = ']', ?string $thisYear = null): string
Format a date and time without redundant information
Format a date and time without redundant information
|
#
|
public
static
|
dateRange(
?DateTimeInterface $from,
?DateTimeInterface $to,
string $delimiter = '–',
string $before = '[',
?string $after = ']',
?string $thisYear = null,
): string
Format a date and time range without redundant information
Format a date and time range without redundant information
|
#
|
public
static
|
bytes(?int $bytes, int $precision = 3, bool $binary = true): string
Format a size in bytes by rounding to an appropriate binary or decimal
unit (B, KiB/kB, MiB/MB, GiB/GB, ...)
Format a size in bytes by rounding to an appropriate binary or decimal
unit (B, KiB/kB, MiB/MB, GiB/GB, ...)
|
#
|