PHP Class MathPHP\Functions\Support

Show file Open project: markrogoyski/math-php Class Usage Examples

Public Methods

Method Description
checkLimits ( array $limits, array $params ) : boolean Checks that the values of the parameters passed to a function fall within the defined bounds.

Method Details

checkLimits() public static method

The parameter limits are defined using ISO 31-11 notation. https://en.wikipedia.org/wiki/ISO_31-11 (a,b) = a < x < b [a,b) = a <= x < b (a,b] = a < x <= b [a,b] = a <= x <= b
public static checkLimits ( array $limits, array $params ) : boolean
$limits array Boundary limit definitions for each parameter ['var1' => limit, 'var2' => limit, ...]
$params array Parameters and their value to check against the defined limits ['var1' => value, 'var2' => value, ...]
return boolean True if all parameters are within defined limits