From 854711656c9f182f64d86d642e944293d78ebab1 Mon Sep 17 00:00:00 2001 From: Travis Swientek Date: Fri, 2 Aug 2013 16:32:22 -0700 Subject: [PATCH] Fixed an issue with HTTPBroker, Lists, Routes and Stats --- src/Mailgun/Connection/HttpBroker.php | 4 ++-- src/Mailgun/Lists/Lists.php | 2 +- src/Mailgun/Routes/Routes.php | 2 +- src/Mailgun/Stats/Stats.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Mailgun/Connection/HttpBroker.php b/src/Mailgun/Connection/HttpBroker.php index 485cd2f..b7433e8 100644 --- a/src/Mailgun/Connection/HttpBroker.php +++ b/src/Mailgun/Connection/HttpBroker.php @@ -51,8 +51,8 @@ class HttpBroker{ public function getRequest($endpointUrl, $queryString = array()){ $request = $this->mgClient->get($endpointUrl); - foreach($queryString as $queryKey=>$queryValue){ - $request->getQuery()->set($queryKey, $queryValue); + foreach($queryString as $key=>$value){ + $request->getQuery()->set($key, $value); } $response = $request->send(); return $this->responseHandler($response); diff --git a/src/Mailgun/Lists/Lists.php b/src/Mailgun/Lists/Lists.php index 4a62667..d289dbe 100644 --- a/src/Mailgun/Lists/Lists.php +++ b/src/Mailgun/Lists/Lists.php @@ -14,7 +14,7 @@ class Lists{ public function __construct($httpBroker){ $this->httpBroker = $httpBroker; - $this->endpointUrl = $this->httpBroker->returnWorkingDomain() . "/lists"; + $this->endpointUrl = "lists"; } diff --git a/src/Mailgun/Routes/Routes.php b/src/Mailgun/Routes/Routes.php index c964ff0..bd2ae5c 100644 --- a/src/Mailgun/Routes/Routes.php +++ b/src/Mailgun/Routes/Routes.php @@ -15,7 +15,7 @@ class Routes{ public function __construct($httpBroker){ $this->httpBroker = $httpBroker; - $this->endpointUrl = $this->httpBroker->returnWorkingDomain() . "/routes"; + $this->endpointUrl = "routes"; } public function getRoutes($limit, $skip){ diff --git a/src/Mailgun/Stats/Stats.php b/src/Mailgun/Stats/Stats.php index 561c5cd..1a11a2f 100644 --- a/src/Mailgun/Stats/Stats.php +++ b/src/Mailgun/Stats/Stats.php @@ -25,8 +25,8 @@ class Stats{ return $response; } - public function getStats($limit, $skip){ - $response = $this->httpBroker->getRequest($this->statsEndpointUrl, array($limit, $skip, $event, $start-date)); + public function getStats($filterParams = array()){ + $response = $this->httpBroker->getRequest($this->statsEndpointUrl, $filterParams); return $response; } } \ No newline at end of file