From 73cbf3d56d0b4ac93696db5911c5992518fbe2d6 Mon Sep 17 00:00:00 2001 From: Andrei Susanu Date: Mon, 8 Apr 2019 13:51:34 +0300 Subject: [PATCH] Accepting port ranges when creating firewall rules API definition: port string (optional) TCP/UDP only. This field can be an integer value specifying a port or a colon separated port range. @see https://www.vultr.com/api/#firewall --- src/ApiCall/Firewall.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ApiCall/Firewall.php b/src/ApiCall/Firewall.php index 08d7740..42f3be5 100644 --- a/src/ApiCall/Firewall.php +++ b/src/ApiCall/Firewall.php @@ -109,7 +109,7 @@ public function setGroupDescription($groupId, $description) * @param string $subnet IP address representing a subnet. The IP * address format must match with the "ip_type" parameter value. * @param integer $subnetSize IP prefix size in bits. - * @param integer $port (optional) TCP/UDP only. This field can be an + * @param integer|string $port (optional) TCP/UDP only. This field can be an * integer value specifying a port or a colon separated port range. * @param string $direction Direction of rule. Possible values: "in". * @@ -154,7 +154,7 @@ public function createRule( ]; if ($port !== null) { - $args['port'] = (int) $port; + $args['port'] = $port; } $rule = $this->adapter->post('firewall/rule_create', $args);