From 9fdf360b811a8bc433e0c9428b0a9803573cce15 Mon Sep 17 00:00:00 2001 From: David Stotijn Date: Tue, 14 Nov 2017 18:54:02 +0100 Subject: [PATCH] Add optional `parameters` function argument where applicable --- src/MessageBird/Client.php | 2 +- src/MessageBird/Resources/Contacts.php | 10 ++++++---- src/MessageBird/Resources/Groups.php | 5 +++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/MessageBird/Client.php b/src/MessageBird/Client.php index 37487a41..f6eeb832 100644 --- a/src/MessageBird/Client.php +++ b/src/MessageBird/Client.php @@ -13,7 +13,7 @@ class Client const CHATAPI_ENDPOINT = 'https://chat.messagebird.com/1'; const VOICEAPI_ENDPOINT = 'https://voice.messagebird.com'; - const CLIENT_VERSION = '1.9.1'; + const CLIENT_VERSION = '1.9.2'; /** * @var string diff --git a/src/MessageBird/Resources/Contacts.php b/src/MessageBird/Resources/Contacts.php index 54e5d8ea..0b2ade0e 100644 --- a/src/MessageBird/Resources/Contacts.php +++ b/src/MessageBird/Resources/Contacts.php @@ -53,9 +53,10 @@ public function update($object, $id) /** * @param $id + * @param array|null $parameters * @return $this ->Object */ - public function getMessages($id) + public function getMessages($id, $parameters = array()) { if (is_null($id)) { throw new InvalidArgumentException('No contact id provided.'); @@ -63,14 +64,15 @@ public function getMessages($id) $this->setObject(new Objects\Message()); $this->setResourceName($this->resourceName . '/' . $id . '/messages'); - return $this->getList(); + return $this->getList($parameters); } /** * @param $id + * @param array|null $parameters * @return $this ->Object */ - public function getGroups($id) + public function getGroups($id, $parameters = array()) { if (is_null($id)) { throw new InvalidArgumentException('No contact id provided.'); @@ -78,6 +80,6 @@ public function getGroups($id) $this->setObject(new Objects\Group()); $this->setResourceName($this->resourceName . '/' . $id . '/groups'); - return $this->getList(); + return $this->getList($parameters); } } diff --git a/src/MessageBird/Resources/Groups.php b/src/MessageBird/Resources/Groups.php index 321ce5fc..00a8fa25 100644 --- a/src/MessageBird/Resources/Groups.php +++ b/src/MessageBird/Resources/Groups.php @@ -61,19 +61,20 @@ public function update($object, $id) /** * @param string $id + * @param array|null $parameters * * @throws InvalidArgumentException * * @return mixed */ - public function getContacts($id = null) + public function getContacts($id = null, $parameters = array()) { if (is_null($id)) { throw new InvalidArgumentException('No group id provided.'); } $this->setResourceName($this->resourceName . '/' . $id . '/contacts'); - return $this->getList(); + return $this->getList($parameters); } /**