public static function type_integer($var, array $settings)
	{
		if (is_array($var) or is_object($var))
		{
			throw new InvalidContentType('Array or object could not be converted to integer.');
		}

		if ((array_key_exists('min', $settings) and $var < intval($settings['min']))
			or (array_key_exists('max', $settings) and $var > intval($settings['max'])))
		{
			throw new InvalidContentType('Integer value outside of range: '.$var);
		}

		return intval($var);
	}
public static function type_integer($var, array $settings)
	{
		if (is_array($var) or is_object($var))
		{
			throw new InvalidContentType('Array or object could not be converted to integer.');
		}

		if ((array_key_exists('min', $settings) and $var < intval($settings['min']))
			or (array_key_exists('max', $settings) and $var > intval($settings['max'])))
		{
			throw new InvalidContentType('Integer value outside of range: '.$var);
		}

		return intval($var);
	}
public static function type_integer ( $ var , array $ settings ) { if ( is_array ( $ var ) or is_object ( $ var ) ) { throw new InvalidContentType ( 'Array or object could not be converted to integer.' ) ; } if ( ( array_key_exists ( 'min' , $ settings ) and $ var < intval ( $ settings [ 'min' ] ) ) or ( array_key_exists ( 'max' , $ settings ) and $ var > intval ( $ settings [ 'max' ] ) ) ) { throw new InvalidContentType ( 'Integer value outside of range: ' . $ var ) ; } return intval ( $ var ) ; }
Casts to int when necessary and checks if within max values

@param   mixed  value to typecast
@param   array  any options to be passed

@throws  InvalidContentType

@return  int
Casts to int when necessary and checks if within max values