Helpers
class Helpers
Methods
Executes a callback and returns the captured output as a string.
Returns the last occurred PHP error or an empty string if no error occurred. Unlike error_get_last(), it is nit affected by the PHP directive html_errors and always returns text, not HTML.
Converts false to null, does not change other values.
Returns value clamped to the inclusive range of min and max.
Looks for a string from possibilities that is most similar to value, but not the same (for 8-bit encoding).
Details
at line 18
static string
capture(callable $func)
Executes a callback and returns the captured output as a string.
at line 35
static string
getLastError()
Returns the last occurred PHP error or an empty string if no error occurred. Unlike error_get_last(), it is nit affected by the PHP directive html_errors and always returns text, not HTML.
at line 49
static mixed
falseToNull(mixed $value)
Converts false to null, does not change other values.
at line 62
static int|float
clamp(int|float $value, int|float $min, int|float $max)
Returns value clamped to the inclusive range of min and max.
at line 75
static string|null
getSuggestion(array $possibilities, string $value)
Looks for a string from possibilities that is most similar to value, but not the same (for 8-bit encoding).