Util
in package
Utilty functions
Tags
Table of Contents
- checkRange() : mixed
- Asserts that `value` falls within `range` (inclusive), leaving room for slight floating-point errors.
- encodeURIComponent() : string
- Encode URI component
Methods
checkRange()
Asserts that `value` falls within `range` (inclusive), leaving room for slight floating-point errors.
public
static checkRange(string $name, Range $range, array<string|int, mixed> $value[, string $unit = '' ]) : mixed
Parameters
- $name : string
-
The name of the value. Used in the error message.
- $range : Range
-
Range of values.
- $value : array<string|int, mixed>
-
The value to check.
- $unit : string = ''
-
The unit of the value. Used in error reporting.
Tags
Return values
mixed —value adjusted to fall within range, if it was outside by a floating-point margin.
encodeURIComponent()
Encode URI component
public
static encodeURIComponent(string $string) : string
Parameters
- $string : string