class Utils (View source)

Methods

static  bool
__callStatic( string $function, object $configObject)

Magic method as an alias to is_a($object, $type)

static  string
arrayToPipedString( array $defaultValues)

Takes an array of values and ouputs them as a string between brackets and separated by a pipe.

static  bool
arrayIsMulti( array $array)

Simple test to see if array is multi-dimensional.

static  bool
arrayValuesCheck( array $array, string $type, string $className = '')

Simple test to see if array values are of specified type.

static  bool
isIntOrPercent( mixed $val)

Tests input for valid int or percent

static  bool
between( mixed $lower, mixed $test, mixed $upper, bool $includeLimits = true)

Test if a number is between two other numbers.

static  bool
nonEmptyString( string $var)

Checks if variable is a non-empty string

static  bool
nonEmptyStringInArray( string $var, array $arr)

Checks if variable is a non-empty string within an array of values

Details

at line 13
static bool __callStatic( string $function, object $configObject)

Magic method as an alias to is_a($object, $type)

Parameters

string $function
object $configObject

Return Value

bool

at line 38
static string arrayToPipedString( array $defaultValues)

Takes an array of values and ouputs them as a string between brackets and separated by a pipe.

Parameters

array $defaultValues Array of default values

Return Value

string Converted array to string.

at line 63
static bool arrayIsMulti( array $array)

Simple test to see if array is multi-dimensional.

Parameters

array $array Array of values.

Return Value

bool Returns true is first element in the array is an array, otherwise false.

at line 85
static bool arrayValuesCheck( array $array, string $type, string $className = '')

Simple test to see if array values are of specified type.

Parameters

array $array Array of values.
string $type Type to check
string $className Named class, if type == 'class'

Return Value

bool Returns true is all values match type, otherwise false.

at line 134
static bool isIntOrPercent( mixed $val)

Tests input for valid int or percent

Valid int = 5 or 12 Valid percent = 32% or 100%

Parameters

mixed $val Integer or string.

Return Value

bool Returns true if valid in or percent, otherwise false.

at line 173
static bool between( mixed $lower, mixed $test, mixed $upper, bool $includeLimits = true)

Test if a number is between two other numbers.

Pass in the number to test, the lower limit and upper limit. Defaults to including the limits with <= & >=, set to false to exclude the limits with < & >

Parameters

mixed $lower number to test
mixed $test lower limit
mixed $upper upper limit
bool $includeLimits whether to include limits

Return Value

bool

at line 197
static bool nonEmptyString( string $var)

Checks if variable is a non-empty string

Parameters

string $var

Return Value

bool

at line 214
static bool nonEmptyStringInArray( string $var, array $arr)

Checks if variable is a non-empty string within an array of values

Parameters

string $var
array $arr

Return Value

bool