Leafo\ScssPhp\Util::checkRange
Asserts that `value` falls within `range` (inclusive), leaving room for slight floating-point errors.
Signature
public function checkRange(string
$name,
Range
$range,
array
$value,
[string
$unit = ''] )
Parameters
$name
—
string
- The name of the value. Used in the error message.
$range
—
Leafo\ScssPhp\Base\Range
- Range of values.
$value
—
array
- The value to check.
$unit
—
string
- The unit of the value. Used in error reporting.
Returns
- mixed
- `value` adjusted to fall within range, if it was outside by a floating-point margin.
Errors/Exceptions
-
RangeException