src/Internal/CoOption.php
private static function validateNaturalInt($key, $value)
    {
        $value = filter_var($value, FILTER_VALIDATE_INT);
        if ($value === false) {
            throw new \InvalidArgumentException("Option[$key] must be integer.");
        }
        if ($value < 0) {
            throw new \DomainException("Option[$key] must be positive or zero.");
        }
        return $value;
    }
private static function validateNaturalInt($key, $value)
    {
        $value = filter_var($value, FILTER_VALIDATE_INT);
        if ($value === false) {
            throw new \InvalidArgumentException("Option[$key] must be integer.");
        }
        if ($value < 0) {
            throw new \DomainException("Option[$key] must be positive or zero.");
        }
        return $value;
    }
private static function validateNaturalInt ( $ key , $ value ) { $ value = filter_var ( $ value , FILTER_VALIDATE_INT ) ; if ( $ value === false ) { throw new \ InvalidArgumentException ( "Option[$key] must be integer." ) ; } if ( $ value < 0 ) { throw new \ DomainException ( "Option[$key] must be positive or zero." ) ; } return $ value ; }
Validate natural int value.
@param  string $key
@param  mixed  $value
@throws InvalidArgumentException
@return int
Validate natural int value .