From bc35c87b15c11c4938a64eeea779e789a4172fce Mon Sep 17 00:00:00 2001 From: Adam Malone Date: Thu, 14 Sep 2017 08:20:18 +1000 Subject: [PATCH] Adds the query parameter to the guzzle call for GET requests. --- src/Adapter/Adapter.php | 2 +- src/Adapter/Guzzle.php | 4 ++-- src/Endpoints/DNS.php | 2 +- src/Endpoints/PageRules.php | 2 +- src/Endpoints/UARules.php | 2 +- src/Endpoints/ZoneLockdown.php | 2 +- src/Endpoints/Zones.php | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Adapter/Adapter.php b/src/Adapter/Adapter.php index e94feb48..b8416dd3 100644 --- a/src/Adapter/Adapter.php +++ b/src/Adapter/Adapter.php @@ -35,7 +35,7 @@ public function __construct(Auth $auth, String $baseURI); * * @return mixed */ - public function get(String $uri, array $headers): ResponseInterface; + public function get(String $uri, array $query, array $headers): ResponseInterface; /** * @param String $uri diff --git a/src/Adapter/Guzzle.php b/src/Adapter/Guzzle.php index fad81294..f57c1ea5 100644 --- a/src/Adapter/Guzzle.php +++ b/src/Adapter/Guzzle.php @@ -38,9 +38,9 @@ public function __construct(Auth $auth, String $baseURI = null) /** * @inheritDoc */ - public function get(String $uri, array $headers = array()): ResponseInterface + public function get(String $uri, array $query = array(), $headers = array()): ResponseInterface { - $response = $this->client->get($uri, ['headers' => $headers]); + $response = $this->client->get($uri, ['query' => $query, 'headers' => $headers]); $this->checkError($response); return $response; diff --git a/src/Endpoints/DNS.php b/src/Endpoints/DNS.php index 6b354ff9..98a72474 100644 --- a/src/Endpoints/DNS.php +++ b/src/Endpoints/DNS.php @@ -88,7 +88,7 @@ public function listRecords( $query = http_build_query($options); - $user = $this->adapter->get('zones/' . $zoneID . '/dns_records?' . $query, []); + $user = $this->adapter->get('zones/' . $zoneID . '/dns_records', $query, []); $body = json_decode($user->getBody()); $result = new \stdClass(); diff --git a/src/Endpoints/PageRules.php b/src/Endpoints/PageRules.php index 5e1a8976..22fe2555 100644 --- a/src/Endpoints/PageRules.php +++ b/src/Endpoints/PageRules.php @@ -86,7 +86,7 @@ public function listPageRules( $query = http_build_query($options); - $user = $this->adapter->get('zones/' . $zoneID . '/pagerules?' . $query, []); + $user = $this->adapter->get('zones/' . $zoneID . '/pagerules', $query, []); $body = json_decode($user->getBody()); $result = new \stdClass(); diff --git a/src/Endpoints/UARules.php b/src/Endpoints/UARules.php index 7c9010d4..b5be76cf 100644 --- a/src/Endpoints/UARules.php +++ b/src/Endpoints/UARules.php @@ -31,7 +31,7 @@ public function listRules( $query = http_build_query($options); - $user = $this->adapter->get('zones/' . $zoneID . '/firewall/ua_rules?' . $query, []); + $user = $this->adapter->get('zones/' . $zoneID . '/firewall/ua_rules', $query, []); $body = json_decode($user->getBody()); $result = new \stdClass(); diff --git a/src/Endpoints/ZoneLockdown.php b/src/Endpoints/ZoneLockdown.php index 5f4b5d92..34127b1d 100644 --- a/src/Endpoints/ZoneLockdown.php +++ b/src/Endpoints/ZoneLockdown.php @@ -31,7 +31,7 @@ public function listLockdowns( $query = http_build_query($options); - $user = $this->adapter->get('zones/' . $zoneID . '/firewall/lockdowns?' . $query, []); + $user = $this->adapter->get('zones/' . $zoneID . '/firewall/lockdowns', $query, []); $body = json_decode($user->getBody()); $result = new \stdClass(); diff --git a/src/Endpoints/Zones.php b/src/Endpoints/Zones.php index 13dc83bd..f10f2c21 100644 --- a/src/Endpoints/Zones.php +++ b/src/Endpoints/Zones.php @@ -82,7 +82,7 @@ public function listZones( $query = http_build_query($options); - $user = $this->adapter->get('zones?' . $query, []); + $user = $this->adapter->get('zones', $query, []); $body = json_decode($user->getBody()); $result = new \stdClass();