Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
ScssPhp\ScssPhp\Util Class Reference

Utility functions. More...

Static Public Member Functions

static checkRange ($name, Range $range, $value, $unit='')
 Asserts that value falls within range (inclusive), leaving room for slight floating-point errors.
 
static encodeURIComponent ($string)
 Encode URI component.
 
static mbChr ($code)
 mb_chr() wrapper
 
static mbStrlen ($string)
 mb_strlen() wrapper
 
static mbStrpos ($haystack, $needle, $offset=0)
 mb_strpos wrapper
 
static mbSubstr ($string, $start, $length=null)
 mb_substr() wrapper
 

Detailed Description

Utility functions.

Author
Anthon Pang antho.nosp@m.n.pa.nosp@m.ng@gm.nosp@m.ail..nosp@m.com

Member Function Documentation

◆ checkRange()

static ScssPhp\ScssPhp\Util::checkRange ( $name,
Range $range,
$value,
$unit = '' )
static

Asserts that value falls within range (inclusive), leaving room for slight floating-point errors.

Parameters
string$nameThe name of the value. Used in the error message.
Range$rangeRange of values.
array | Number$valueThe value to check.
string$unitThe unit of the value. Used in error reporting.
Return values
mixedvalue adjusted to fall within range, if it was outside by a floating-point margin.
Exceptions
ScssPhp\ScssPhp\Exception\RangeException

◆ encodeURIComponent()

static ScssPhp\ScssPhp\Util::encodeURIComponent ( $string)
static

Encode URI component.

Parameters
string$string
Return values
string

◆ mbChr()

static ScssPhp\ScssPhp\Util::mbChr ( $code)
static

mb_chr() wrapper

Parameters
int$code
Return values
string

◆ mbStrlen()

static ScssPhp\ScssPhp\Util::mbStrlen ( $string)
static

mb_strlen() wrapper

Parameters
string$string
Return values
int

◆ mbStrpos()

static ScssPhp\ScssPhp\Util::mbStrpos ( $haystack,
$needle,
$offset = 0 )
static

mb_strpos wrapper

Parameters
string$haystack
string$needle
int$offset
Return values
int|false

◆ mbSubstr()

static ScssPhp\ScssPhp\Util::mbSubstr ( $string,
$start,
$length = null )
static

mb_substr() wrapper

Parameters
string$string
int$start
null | int$length
Return values
string

The documentation for this class was generated from the following file: