public static function ip($value, $flag = null, $message = null, $propertyPath = null)
{
self::string($value, $message, $propertyPath);
if (!filter_var($value, FILTER_VALIDATE_IP, $flag)) {
$message = sprintf($message ?: 'Value "%s" was expected to be a valid IP address.', self::stringify($value));
throw static::createException($value, $message, static::INVALID_IP, $propertyPath);
}
return true;
}