protected static validateBoolean ( boolean $test, string $source ) | ||
$test | boolean | the input to test |
$source | string | the name of the function calling this |
protected static function validateBoolean($test, $source)
{
if (!($test === true || $test === false)) {
throw new InvalidArgumentException("Argument to {$source} must be a boolean");
}
}