diff --git a/examples/available-phone-numbers-view.php b/examples/available-phone-numbers-view.php index e0111391..6807edea 100644 --- a/examples/available-phone-numbers-view.php +++ b/examples/available-phone-numbers-view.php @@ -7,14 +7,10 @@ try { $phoneNumbers = $messageBird->availablePhoneNumbers->getList("nl", []); var_dump($phoneNumbers); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { var_dump($e->getMessage()); // That means that your accessKey is unknown print("wrong login\n"); - } catch (\Exception $e) { var_dump($e->getMessage()); - } -?> diff --git a/examples/balance-view.php b/examples/balance-view.php index 849ea3ab..71fa12ce 100644 --- a/examples/balance-view.php +++ b/examples/balance-view.php @@ -7,12 +7,9 @@ try { $balance = $messageBird->balance->read(); var_dump($balance); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); - } diff --git a/examples/chatchannels-create.php b/examples/chatchannels-create.php index 365e4bcf..2e5f49f7 100644 --- a/examples/chatchannels-create.php +++ b/examples/chatchannels-create.php @@ -23,11 +23,9 @@ try { $chatChannelResult = $messageBird->chatChannels->create($chatChannel); var_dump($chatChannelResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/chatchannels-delete.php b/examples/chatchannels-delete.php index fd10f551..96f3ad93 100644 --- a/examples/chatchannels-delete.php +++ b/examples/chatchannels-delete.php @@ -7,11 +7,9 @@ try { $deleted = $messageBird->chatChannels->delete('4affac2c577fb22e373921n52675409'); // Set a message id here var_dump('Deleted: ' . $deleted); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/chatchannels-list.php b/examples/chatchannels-list.php index 89ffd14b..bf3b83e9 100644 --- a/examples/chatchannels-list.php +++ b/examples/chatchannels-list.php @@ -7,11 +7,9 @@ try { $chatChannelResult = $messageBird->chatChannels->getList(); var_dump($chatChannelResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/chatchannels-update.php b/examples/chatchannels-update.php index 05720c29..cb6aa112 100644 --- a/examples/chatchannels-update.php +++ b/examples/chatchannels-update.php @@ -11,11 +11,9 @@ try { $chatChannelResult = $messageBird->chatChannels->update($chatChannel, '331af4c577e3asbbc3631455680736'); var_dump($chatChannelResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/chatchannels-view.php b/examples/chatchannels-view.php index ab85839b..88e823dd 100644 --- a/examples/chatchannels-view.php +++ b/examples/chatchannels-view.php @@ -7,11 +7,9 @@ try { $chatChannelResult = $messageBird->chatChannels->read('0051af4c577e3eebbc3631n95680736'); // Set a channel id here var_dump($chatChannelResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/chatcontacts-delete.php b/examples/chatcontacts-delete.php index ba6cd815..b47b834c 100644 --- a/examples/chatcontacts-delete.php +++ b/examples/chatcontacts-delete.php @@ -7,11 +7,9 @@ try { $deleted = $messageBird->chatContacts->delete('4affa2345d7fb22e373921n524df5409'); // Set a contact id var_dump('Deleted : ' . $deleted); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/chatcontacts-list.php b/examples/chatcontacts-list.php index 4f74306e..56e963e5 100644 --- a/examples/chatcontacts-list.php +++ b/examples/chatcontacts-list.php @@ -7,11 +7,9 @@ try { $chatContactResult = $messageBird->chatContacts->getList(); var_dump($chatContactResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/chatcontacts-view.php b/examples/chatcontacts-view.php index accc082b..abe07050 100644 --- a/examples/chatcontacts-view.php +++ b/examples/chatcontacts-view.php @@ -7,11 +7,9 @@ try { $chatContactResult = $messageBird->chatContacts->read('0051af4c577e3eebbc3631n95680736'); // Set a contact id here var_dump($chatContactResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/chatmessages-create.php b/examples/chatmessages-create.php index cd08818b..d46f6aa4 100644 --- a/examples/chatmessages-create.php +++ b/examples/chatmessages-create.php @@ -12,15 +12,12 @@ try { $chatMessageResult = $messageBird->chatMessages->create($chatMessage); var_dump($chatMessageResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\MessageBird\Exceptions\BalanceException $e) { // That means that you are out of credits, so do something about it. echo 'no balance'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/chatmessages-list.php b/examples/chatmessages-list.php index 6825d2d1..221f61ea 100644 --- a/examples/chatmessages-list.php +++ b/examples/chatmessages-list.php @@ -9,11 +9,9 @@ try { $chatMessageResult = $messageBird->chatMessages->getList(); var_dump($chatMessageResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/chatmessages-view.php b/examples/chatmessages-view.php index 8286aed0..c27e8080 100644 --- a/examples/chatmessages-view.php +++ b/examples/chatmessages-view.php @@ -9,11 +9,9 @@ try { $messageResult = $messageBird->chatMessages->read('d6508edc578ca7641e3919n79796670'); // Set a message id here var_dump($messageResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/chatplatforms-list.php b/examples/chatplatforms-list.php index 7d4111dc..0555eb0b 100644 --- a/examples/chatplatforms-list.php +++ b/examples/chatplatforms-list.php @@ -9,11 +9,9 @@ try { $chatPlatformResult = $messageBird->chatPlatforms->getList(); var_dump($chatPlatformResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/contact-create.php b/examples/contact-create.php index a9536ded..ce709093 100644 --- a/examples/contact-create.php +++ b/examples/contact-create.php @@ -17,11 +17,9 @@ try { $contactResult = $messageBird->contacts->create($contact); var_dump($contactResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/contact-delete.php b/examples/contact-delete.php index 8fd5b745..da2f688d 100644 --- a/examples/contact-delete.php +++ b/examples/contact-delete.php @@ -7,12 +7,9 @@ try { $deleted = $messageBird->contacts->delete('123_contact_id'); // Set a contact id here var_dump('Deleted: ' . $deleted); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); - } diff --git a/examples/contact-get-groups.php b/examples/contact-get-groups.php index a04888de..1716af06 100644 --- a/examples/contact-get-groups.php +++ b/examples/contact-get-groups.php @@ -7,11 +7,9 @@ try { $contactGroupsList = $messageBird->contacts->getGroups('contact_id'); var_dump($contactGroupsList); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/contact-get-messages.php b/examples/contact-get-messages.php index 8d2ef615..f17afa55 100644 --- a/examples/contact-get-messages.php +++ b/examples/contact-get-messages.php @@ -7,11 +7,9 @@ try { $contactMessageList = $messageBird->contacts->getMessages('contact_id'); var_dump($contactMessageList); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/contact-list.php b/examples/contact-list.php index a148c8cc..4a2e232d 100644 --- a/examples/contact-list.php +++ b/examples/contact-list.php @@ -5,13 +5,11 @@ $messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here. try { - $contactList = $messageBird->contacts->getList( []); + $contactList = $messageBird->contacts->getList([]); var_dump($contactList); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/contact-update.php b/examples/contact-update.php index c87422f7..285243e4 100644 --- a/examples/contact-update.php +++ b/examples/contact-update.php @@ -17,11 +17,9 @@ try { $groupResult = $messageBird->contacts->update($contact, 'contact_id'); var_dump($groupResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/contact-view.php b/examples/contact-view.php index 3e50f3d8..9f18f108 100644 --- a/examples/contact-view.php +++ b/examples/contact-view.php @@ -7,11 +7,9 @@ try { $contactResult = $messageBird->contacts->read('123_contact_id'); // Set a contact id here var_dump($contactResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/conversations/enable-whatsapp-sandbox.php b/examples/conversations/enable-whatsapp-sandbox.php index 6c8decf0..9e0c1855 100644 --- a/examples/conversations/enable-whatsapp-sandbox.php +++ b/examples/conversations/enable-whatsapp-sandbox.php @@ -10,7 +10,7 @@ // Create a client with WhatsApp sandbox enabled. $messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY', null, [\MessageBird\Client::ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX]); -// Use WhatsApp sandbox channel as normal. +// Use WhatsApp sandbox channel as normal. $content = new \MessageBird\Objects\Conversation\Content(); $content->text = 'Hello world'; diff --git a/examples/group-add-contact-to-group.php b/examples/group-add-contact-to-group.php index 5e2330ff..705f1d2c 100644 --- a/examples/group-add-contact-to-group.php +++ b/examples/group-add-contact-to-group.php @@ -12,11 +12,9 @@ $group_id = 'group_id'; $groupAddContact = $messageBird->groups->addContacts($contacts, $group_id); var_dump($groupAddContact); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/group-create.php b/examples/group-create.php index 07af8ba9..49e381a0 100644 --- a/examples/group-create.php +++ b/examples/group-create.php @@ -10,11 +10,9 @@ try { $groupResult = $messageBird->groups->create($group); var_dump($groupResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/group-delete.php b/examples/group-delete.php index 2214565c..829e5315 100644 --- a/examples/group-delete.php +++ b/examples/group-delete.php @@ -7,12 +7,9 @@ try { $deleted = $messageBird->groups->delete('group_id'); // Set a group id here var_dump('Deleted: ' . $deleted); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); - } diff --git a/examples/group-get-contacts.php b/examples/group-get-contacts.php index 01918bc1..2d99cad6 100644 --- a/examples/group-get-contacts.php +++ b/examples/group-get-contacts.php @@ -7,11 +7,9 @@ try { $groupsContactList = $messageBird->groups->getContacts('group_id'); var_dump($groupsContactList); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/group-list.php b/examples/group-list.php index 02898b2f..b9746b5b 100644 --- a/examples/group-list.php +++ b/examples/group-list.php @@ -5,13 +5,11 @@ $messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here. try { - $groupsList = $messageBird->groups->getList( []); + $groupsList = $messageBird->groups->getList([]); var_dump($groupsList); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/group-remove-contact-from-group.php b/examples/group-remove-contact-from-group.php index 92bdf204..cd6da6d1 100644 --- a/examples/group-remove-contact-from-group.php +++ b/examples/group-remove-contact-from-group.php @@ -9,11 +9,9 @@ $group_id = 'group_id'; $groupAddContact = $messageBird->groups->removeContact($contact_id, $group_id); var_dump($groupAddContact); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/group-update.php b/examples/group-update.php index 84890c2d..f0996ebc 100644 --- a/examples/group-update.php +++ b/examples/group-update.php @@ -10,11 +10,9 @@ try { $groupResult = $messageBird->groups->update($group, 'group_id'); var_dump($groupResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/group-view.php b/examples/group-view.php index 29d6d464..24688510 100644 --- a/examples/group-view.php +++ b/examples/group-view.php @@ -7,11 +7,9 @@ try { $groupResult = $messageBird->groups->read('group_id'); // Set a group id here var_dump($groupResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'Wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/hlr-create.php b/examples/hlr-create.php index d9191134..faaf914a 100644 --- a/examples/hlr-create.php +++ b/examples/hlr-create.php @@ -11,16 +11,12 @@ try { $hlrResult = $messageBird->hlr->create($hlr); var_export($hlrResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\MessageBird\Exceptions\BalanceException $e) { // That means that you are out of credits, so do something about it. echo 'no balance'; - } catch (\MessageBird\Exceptions\RequestException $e) { echo $e->getMessage(); - } diff --git a/examples/hlr-list.php b/examples/hlr-list.php index dd2ae49e..7e39b6b0 100644 --- a/examples/hlr-list.php +++ b/examples/hlr-list.php @@ -5,13 +5,11 @@ $messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here. try { - $hlrList = $messageBird->hlr->getList( ['offset' => 100, 'limit' => 30]); + $hlrList = $messageBird->hlr->getList(['offset' => 100, 'limit' => 30]); var_dump($hlrList); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/hlr-view.php b/examples/hlr-view.php index 6e9b0a70..a2675d20 100644 --- a/examples/hlr-view.php +++ b/examples/hlr-view.php @@ -7,11 +7,9 @@ try { $hlrResult = $messageBird->hlr->read('c8143db0152a58755c80492h61377581'); // Set a message id here var_dump($hlrResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/lookup-hlr-view.php b/examples/lookup-hlr-view.php index d1d89ae5..9bbb6e0f 100644 --- a/examples/lookup-hlr-view.php +++ b/examples/lookup-hlr-view.php @@ -15,7 +15,7 @@ // pool for the results $poolCount = 10; - while($poolCount--) { + while ($poolCount--) { $hlr = $messageBird->lookupHlr->read($hlrObject->msisdn); if ($hlr->status !== \MessageBird\Objects\Hlr::STATUS_SENT) { // we have something @@ -24,12 +24,9 @@ } sleep(0.5); } - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); - } diff --git a/examples/lookup-view.php b/examples/lookup-view.php index 701dc28d..15b502e7 100644 --- a/examples/lookup-view.php +++ b/examples/lookup-view.php @@ -13,8 +13,6 @@ } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); - } diff --git a/examples/message-create-unicode.php b/examples/message-create-unicode.php index 143e3d3d..002a92a4 100644 --- a/examples/message-create-unicode.php +++ b/examples/message-create-unicode.php @@ -13,15 +13,12 @@ try { $messageResult = $messageBird->messages->create($message); var_dump($messageResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\MessageBird\Exceptions\BalanceException $e) { // That means that you are out of credits, so do something about it. echo 'no balance'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/message-create.php b/examples/message-create.php index 68dba28a..a124d56d 100644 --- a/examples/message-create.php +++ b/examples/message-create.php @@ -12,15 +12,12 @@ try { $messageResult = $messageBird->messages->create($message); var_dump($messageResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\MessageBird\Exceptions\BalanceException $e) { // That means that you are out of credits, so do something about it. echo 'no balance'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/message-delete.php b/examples/message-delete.php index d1f3584b..7331b7b4 100644 --- a/examples/message-delete.php +++ b/examples/message-delete.php @@ -7,12 +7,9 @@ try { $deleted = $messageBird->messages->delete('deb1fe303539efdf1730124b69920283'); // Set a message id here var_dump('Deleted: ' . $deleted); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); - } diff --git a/examples/message-list.php b/examples/message-list.php index e9819f3b..3bcc2552 100644 --- a/examples/message-list.php +++ b/examples/message-list.php @@ -5,13 +5,11 @@ $messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here. try { - $messageList = $messageBird->messages->getList( ['offset' => 100, 'limit' => 30]); + $messageList = $messageBird->messages->getList(['offset' => 100, 'limit' => 30]); var_dump($messageList); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/message-view.php b/examples/message-view.php index 0a6ab18d..7ab1870e 100644 --- a/examples/message-view.php +++ b/examples/message-view.php @@ -7,11 +7,9 @@ try { $messageResult = $messageBird->messages->read('ad86c8c0153a194a59a17e2b71578856'); // Set a message id here var_dump($messageResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/partner-account-create.php b/examples/partner-account-create.php index 898962ea..9134d9cc 100644 --- a/examples/partner-account-create.php +++ b/examples/partner-account-create.php @@ -10,11 +10,9 @@ try { $partnerAccountResult = $messageBird->partnerAccounts->create($account); var_dump($partnerAccountResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/partner-account-delete.php b/examples/partner-account-delete.php index 1ae79177..7e0ebb7e 100644 --- a/examples/partner-account-delete.php +++ b/examples/partner-account-delete.php @@ -7,11 +7,9 @@ try { $partnerAccountResult = $messageBird->partnerAccounts->delete(1); var_dump($partnerAccountResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/partner-account-list.php b/examples/partner-account-list.php index 87055734..70e56dad 100644 --- a/examples/partner-account-list.php +++ b/examples/partner-account-list.php @@ -7,11 +7,9 @@ try { $partnerAccountResult = $messageBird->partnerAccounts->getList(); var_dump($partnerAccountResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/partner-account-read.php b/examples/partner-account-read.php index 87774b15..26b553f7 100644 --- a/examples/partner-account-read.php +++ b/examples/partner-account-read.php @@ -7,11 +7,9 @@ try { $partnerAccountResult = $messageBird->partnerAccounts->read(1); var_dump($partnerAccountResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/partner-account-update.php b/examples/partner-account-update.php index 072d2aa8..9cc507e3 100644 --- a/examples/partner-account-update.php +++ b/examples/partner-account-update.php @@ -10,11 +10,9 @@ try { $partnerAccountResult = $messageBird->partnerAccounts->update($account, 1); var_dump($partnerAccountResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/phone-numbers-create.php b/examples/phone-numbers-create.php index df8aef7a..a748826c 100644 --- a/examples/phone-numbers-create.php +++ b/examples/phone-numbers-create.php @@ -14,7 +14,6 @@ } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown print("wrong login\n"); - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/phone-numbers-delete.php b/examples/phone-numbers-delete.php index e9bdac10..c6147945 100644 --- a/examples/phone-numbers-delete.php +++ b/examples/phone-numbers-delete.php @@ -10,7 +10,6 @@ } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown print("wrong login\n"); - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/phone-numbers-update.php b/examples/phone-numbers-update.php index d4f27927..d1e5e501 100644 --- a/examples/phone-numbers-update.php +++ b/examples/phone-numbers-update.php @@ -12,7 +12,6 @@ } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown print("wrong login\n"); - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/phone-numbers-view.php b/examples/phone-numbers-view.php index af781340..f46ae0cd 100644 --- a/examples/phone-numbers-view.php +++ b/examples/phone-numbers-view.php @@ -7,13 +7,9 @@ try { $phoneNumbers = $messageBird->phoneNumbers->getList(); var_dump($phoneNumbers); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown print("wrong login\n"); - } catch (\Exception $e) { var_dump($e->getMessage()); - } -?> diff --git a/examples/verify-create.php b/examples/verify-create.php index 47cc4eaa..02ce89ee 100644 --- a/examples/verify-create.php +++ b/examples/verify-create.php @@ -15,15 +15,12 @@ try { $verifyResult = $messageBird->verify->create($verify, $extraOptions); var_dump($verifyResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\MessageBird\Exceptions\BalanceException $e) { // That means that you are out of credits, so do something about it. echo 'no balance'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/verify-verification.php b/examples/verify-verification.php index 6cb9b5e1..09d8b1b7 100644 --- a/examples/verify-verification.php +++ b/examples/verify-verification.php @@ -9,13 +9,11 @@ var_dump($verifyResult); // Check if $verifyResult->getStatus() === MessageBird\Objects\Verify::STATUS_VERIFIED - } catch (\MessageBird\Exceptions\RequestException $e) { echo 'token incorrect'; } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/verify-view.php b/examples/verify-view.php index 06a907fa..91895f5a 100644 --- a/examples/verify-view.php +++ b/examples/verify-view.php @@ -7,11 +7,9 @@ try { $verifyResult = $messageBird->verify->read('05a90ee1155d2f4cdd12440v10006813'); // Set a message id here var_dump($verifyResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/voicemessages-create.php b/examples/voicemessages-create.php index 7faa9beb..97fb7232 100644 --- a/examples/voicemessages-create.php +++ b/examples/voicemessages-create.php @@ -14,15 +14,12 @@ try { $voiceMessageResult = $messageBird->voicemessages->create($voiceMessage); var_dump($voiceMessageResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\MessageBird\Exceptions\BalanceException $e) { // That means that you are out of credits, so do something about it. echo 'no balance'; - } catch (\Exception $e) { echo $e->getMessage(); } diff --git a/examples/voicemessages-list.php b/examples/voicemessages-list.php index b32b1ce5..503847da 100644 --- a/examples/voicemessages-list.php +++ b/examples/voicemessages-list.php @@ -5,13 +5,11 @@ $messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here. try { - $voiceMessageList = $messageBird->voicemessages->getList( ['offset' => 100, 'limit' => 30]); + $voiceMessageList = $messageBird->voicemessages->getList(['offset' => 100, 'limit' => 30]); var_dump($voiceMessageList); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/examples/voicemessages-view.php b/examples/voicemessages-view.php index 989a663e..a83a8820 100644 --- a/examples/voicemessages-view.php +++ b/examples/voicemessages-view.php @@ -7,11 +7,9 @@ try { $voiceMessageResult = $messageBird->voicemessages->read('ca0a8220453bc36ddeb3115a37400870'); // Set a message id here var_dump($voiceMessageResult); - } catch (\MessageBird\Exceptions\AuthenticateException $e) { // That means that your accessKey is unknown echo 'wrong login'; - } catch (\Exception $e) { var_dump($e->getMessage()); } diff --git a/src/MessageBird/Client.php b/src/MessageBird/Client.php index 63272928..bd8a30a4 100644 --- a/src/MessageBird/Client.php +++ b/src/MessageBird/Client.php @@ -269,7 +269,7 @@ public function __construct($accessKey = null, Common\HttpClient $httpClient = n /** * @param mixed $accessKey */ - public function setAccessKey ($accessKey) + public function setAccessKey($accessKey) { $authentication = new Common\Authentication($accessKey); diff --git a/src/MessageBird/Common/Authentication.php b/src/MessageBird/Common/Authentication.php index 2e8edc10..a39bb015 100644 --- a/src/MessageBird/Common/Authentication.php +++ b/src/MessageBird/Common/Authentication.php @@ -9,7 +9,6 @@ */ class Authentication { - public $accessKey; /** diff --git a/src/MessageBird/Common/HttpClient.php b/src/MessageBird/Common/HttpClient.php index 3aba3e2e..3bacad85 100644 --- a/src/MessageBird/Common/HttpClient.php +++ b/src/MessageBird/Common/HttpClient.php @@ -66,18 +66,22 @@ public function __construct($endpoint, $timeout = 10, $connectionTimeout = 2, $h $this->endpoint = $endpoint; if (!is_int($timeout) || $timeout < 1) { - throw new \InvalidArgumentException(sprintf( + throw new \InvalidArgumentException( + sprintf( 'Timeout must be an int > 0, got "%s".', - is_object($timeout) ? get_class($timeout) : gettype($timeout).' '.var_export($timeout, true)) + is_object($timeout) ? get_class($timeout) : gettype($timeout).' '.var_export($timeout, true) + ) ); } $this->timeout = $timeout; if (!is_int($connectionTimeout) || $connectionTimeout < 0) { - throw new \InvalidArgumentException(sprintf( + throw new \InvalidArgumentException( + sprintf( 'Connection timeout must be an int >= 0, got "%s".', - is_object($connectionTimeout) ? get_class($connectionTimeout) : gettype($connectionTimeout).' '.var_export($connectionTimeout, true)) + is_object($connectionTimeout) ? get_class($connectionTimeout) : gettype($connectionTimeout).' '.var_export($connectionTimeout, true) + ) ); } @@ -193,10 +197,10 @@ public function performHttpRequest($method, $resourceName, $query = null, $body curl_setopt($curl, CURLOPT_POSTFIELDS, $body); } elseif ($method === self::REQUEST_DELETE) { curl_setopt($curl, CURLOPT_CUSTOMREQUEST, self::REQUEST_DELETE); - } elseif ($method === self::REQUEST_PUT){ + } elseif ($method === self::REQUEST_PUT) { curl_setopt($curl, CURLOPT_CUSTOMREQUEST, self::REQUEST_PUT); curl_setopt($curl, CURLOPT_POSTFIELDS, $body); - } elseif ($method === self::REQUEST_PATCH){ + } elseif ($method === self::REQUEST_PATCH) { curl_setopt($curl, CURLOPT_CUSTOMREQUEST, self::REQUEST_PATCH); curl_setopt($curl, CURLOPT_POSTFIELDS, $body); } @@ -246,5 +250,4 @@ public function setConnectionTimeout(int $connectionTimeout) $this->connectionTimeout = $connectionTimeout; return $this; } - } diff --git a/src/MessageBird/Common/ResponseError.php b/src/MessageBird/Common/ResponseError.php index 995d917d..af178e72 100644 --- a/src/MessageBird/Common/ResponseError.php +++ b/src/MessageBird/Common/ResponseError.php @@ -40,7 +40,7 @@ class ResponseError public function __construct($body) { if (!empty($body->errors)) { - foreach ($body->errors AS $error) { + foreach ($body->errors as $error) { // Voice API returns errors with a "message" field instead of "description". // This ensures all errors have a description set. if (!empty($error->message)) { @@ -82,7 +82,7 @@ public function getErrorString() { $errorDescriptions = []; - foreach ($this->errors AS $error) { + foreach ($this->errors as $error) { $errorDescriptions[] = $error->description; } diff --git a/src/MessageBird/Exceptions/AuthenticateException.php b/src/MessageBird/Exceptions/AuthenticateException.php index 435c4944..a71f1bff 100644 --- a/src/MessageBird/Exceptions/AuthenticateException.php +++ b/src/MessageBird/Exceptions/AuthenticateException.php @@ -9,5 +9,4 @@ */ class AuthenticateException extends MessageBirdException { - } diff --git a/src/MessageBird/Exceptions/BalanceException.php b/src/MessageBird/Exceptions/BalanceException.php index a6e8e288..cf16b0a5 100644 --- a/src/MessageBird/Exceptions/BalanceException.php +++ b/src/MessageBird/Exceptions/BalanceException.php @@ -9,5 +9,4 @@ */ class BalanceException extends MessageBirdException { - } diff --git a/src/MessageBird/Exceptions/HttpException.php b/src/MessageBird/Exceptions/HttpException.php index 8e182bf4..59e7affe 100644 --- a/src/MessageBird/Exceptions/HttpException.php +++ b/src/MessageBird/Exceptions/HttpException.php @@ -9,5 +9,4 @@ */ class HttpException extends MessageBirdException { - } diff --git a/src/MessageBird/Exceptions/MessageBirdException.php b/src/MessageBird/Exceptions/MessageBirdException.php index bb681acd..a2b3a11e 100644 --- a/src/MessageBird/Exceptions/MessageBirdException.php +++ b/src/MessageBird/Exceptions/MessageBirdException.php @@ -8,5 +8,4 @@ */ abstract class MessageBirdException extends \Exception { - } diff --git a/src/MessageBird/Exceptions/RequestException.php b/src/MessageBird/Exceptions/RequestException.php index 282c1c76..2381a988 100644 --- a/src/MessageBird/Exceptions/RequestException.php +++ b/src/MessageBird/Exceptions/RequestException.php @@ -9,5 +9,4 @@ */ class RequestException extends MessageBirdException { - } diff --git a/src/MessageBird/Exceptions/ServerException.php b/src/MessageBird/Exceptions/ServerException.php index 6bdeb6ea..17909f18 100644 --- a/src/MessageBird/Exceptions/ServerException.php +++ b/src/MessageBird/Exceptions/ServerException.php @@ -9,5 +9,4 @@ */ class ServerException extends MessageBirdException { - } diff --git a/src/MessageBird/Objects/Base.php b/src/MessageBird/Objects/Base.php index fc84bbe3..b33f96de 100644 --- a/src/MessageBird/Objects/Base.php +++ b/src/MessageBird/Objects/Base.php @@ -17,7 +17,7 @@ class Base public function loadFromArray($object) { if ($object) { - foreach ($object AS $key => $value) { + foreach ($object as $key => $value) { if (property_exists($this, $key)) { $this->$key = $value; } diff --git a/src/MessageBird/Objects/BaseList.php b/src/MessageBird/Objects/BaseList.php index f9e78440..4f0e2cd6 100644 --- a/src/MessageBird/Objects/BaseList.php +++ b/src/MessageBird/Objects/BaseList.php @@ -9,7 +9,6 @@ */ class BaseList extends Base { - public $limit; public $offset; public $count; diff --git a/src/MessageBird/Objects/Chat/Channel.php b/src/MessageBird/Objects/Chat/Channel.php index 31858847..115637e8 100644 --- a/src/MessageBird/Objects/Chat/Channel.php +++ b/src/MessageBird/Objects/Chat/Channel.php @@ -79,5 +79,4 @@ class Channel extends Base * @var array */ protected $_links = []; - } diff --git a/src/MessageBird/Objects/Chat/Contact.php b/src/MessageBird/Objects/Chat/Contact.php index e2716d17..9d520e67 100644 --- a/src/MessageBird/Objects/Chat/Contact.php +++ b/src/MessageBird/Objects/Chat/Contact.php @@ -67,5 +67,4 @@ class Contact extends Base * @var string */ protected $updatedAt; - -} \ No newline at end of file +} diff --git a/src/MessageBird/Objects/Chat/Platform.php b/src/MessageBird/Objects/Chat/Platform.php index dabf07ad..8c2c3cd1 100644 --- a/src/MessageBird/Objects/Chat/Platform.php +++ b/src/MessageBird/Objects/Chat/Platform.php @@ -73,5 +73,4 @@ class Platform extends Base * @var array */ protected $_links; - -} \ No newline at end of file +} diff --git a/src/MessageBird/Objects/Contact.php b/src/MessageBird/Objects/Contact.php index c9b39c58..b8f44d3c 100644 --- a/src/MessageBird/Objects/Contact.php +++ b/src/MessageBird/Objects/Contact.php @@ -179,7 +179,7 @@ public function loadFromArrayForGroups($object) parent::loadFromArray($object); if (!empty($object->items)) { - foreach($object->items AS &$item) { + foreach ($object->items as &$item) { $group = new Group(); $group->loadFromArray($item); diff --git a/src/MessageBird/Objects/Conversation/Channel.php b/src/MessageBird/Objects/Conversation/Channel.php index 02f017b3..a9eb2b54 100644 --- a/src/MessageBird/Objects/Conversation/Channel.php +++ b/src/MessageBird/Objects/Conversation/Channel.php @@ -22,14 +22,14 @@ class Channel extends Base /** * The unique ID generated by the MessageBird platform that identifies this * channel. - * + * * @var string */ public $id; /** * The name of this channel (configured through the MessageBird dashboard). - * + * * @var string */ public $name; @@ -37,7 +37,7 @@ class Channel extends Base /** * A unique identifier for the platform that is used by this channel, for * example: sms, telegram or messenger. - * + * * @var string */ public $platformId; @@ -46,21 +46,21 @@ class Channel extends Base * The status of this channel. Only active channels can be used for * messaging. Can be one of inactive, active, pending, activation_required, * activation_code_required, activating, and deleted. - * + * * @var string */ public $status; /** * The datetime when the message was created (in RFC3339 format). - * + * * @var string */ public $createdDatetime; /** * The datetime when the message was updated (in RFC3339 format). - * + * * @var string */ public $updatedDatetime; diff --git a/src/MessageBird/Objects/Conversation/Fallback.php b/src/MessageBird/Objects/Conversation/Fallback.php index 515d206f..386173c5 100644 --- a/src/MessageBird/Objects/Conversation/Fallback.php +++ b/src/MessageBird/Objects/Conversation/Fallback.php @@ -20,4 +20,4 @@ class Fallback * @var string */ public $after; -} \ No newline at end of file +} diff --git a/src/MessageBird/Objects/Conversation/HSM/Currency.php b/src/MessageBird/Objects/Conversation/HSM/Currency.php index 70727242..fa8e048f 100644 --- a/src/MessageBird/Objects/Conversation/HSM/Currency.php +++ b/src/MessageBird/Objects/Conversation/HSM/Currency.php @@ -13,4 +13,4 @@ class Currency * @var int $amount */ public $amount; -} \ No newline at end of file +} diff --git a/src/MessageBird/Objects/Conversation/HSM/Message.php b/src/MessageBird/Objects/Conversation/HSM/Message.php index b62ac44a..652130e8 100644 --- a/src/MessageBird/Objects/Conversation/HSM/Message.php +++ b/src/MessageBird/Objects/Conversation/HSM/Message.php @@ -24,5 +24,3 @@ class Message */ public $params; } - - diff --git a/src/MessageBird/Objects/Conversation/HSM/Params.php b/src/MessageBird/Objects/Conversation/HSM/Params.php index b67c57ea..b4fff98d 100644 --- a/src/MessageBird/Objects/Conversation/HSM/Params.php +++ b/src/MessageBird/Objects/Conversation/HSM/Params.php @@ -20,4 +20,4 @@ class Params * @var string $dateTime */ public $dateTime; -} \ No newline at end of file +} diff --git a/src/MessageBird/Objects/Conversation/MessageReference.php b/src/MessageBird/Objects/Conversation/MessageReference.php index b362a6e7..add8d4cd 100644 --- a/src/MessageBird/Objects/Conversation/MessageReference.php +++ b/src/MessageBird/Objects/Conversation/MessageReference.php @@ -11,7 +11,7 @@ class MessageReference extends Base { /** * A link to the endpoint to retrieve messages of this conversation. - * + * * @var string */ public $href; @@ -19,7 +19,7 @@ class MessageReference extends Base /** * The total number of messages that can be retrieved for this conversation * through pagination. - * + * * @var int */ public $totalCount; diff --git a/src/MessageBird/Objects/Conversation/SendMessage.php b/src/MessageBird/Objects/Conversation/SendMessage.php index 2679a1b6..fd0386c3 100644 --- a/src/MessageBird/Objects/Conversation/SendMessage.php +++ b/src/MessageBird/Objects/Conversation/SendMessage.php @@ -13,14 +13,14 @@ class SendMessage extends Base implements JsonSerializable /** * Either a channel-specific identifier for the receiver (e.g. MSISDN for SMS or WhatsApp channels), * or the ID of a MessageBird Contact. - * + * * @var string */ public $to; /** * The ID that identifies the channel over which the message should be sent. - * + * * @var string */ public $from; @@ -28,14 +28,14 @@ class SendMessage extends Base implements JsonSerializable /** * Type of this message's content. Possible values: "text", "image", * "audio", "video", "file", "location". - * + * * @var string */ public $type; /** * Content of the message. Implementation dependent on this message's type. - * + * * @var Content */ public $content; @@ -56,7 +56,7 @@ class SendMessage extends Base implements JsonSerializable /** * The source of the response/action that sent the message. - * + * * @var \stdClass */ public $source; diff --git a/src/MessageBird/Objects/Conversation/SendMessageResult.php b/src/MessageBird/Objects/Conversation/SendMessageResult.php index e48b71ba..750d709d 100644 --- a/src/MessageBird/Objects/Conversation/SendMessageResult.php +++ b/src/MessageBird/Objects/Conversation/SendMessageResult.php @@ -32,4 +32,4 @@ public function jsonSerialize() return $json; } -} \ No newline at end of file +} diff --git a/src/MessageBird/Objects/Conversation/Webhook.php b/src/MessageBird/Objects/Conversation/Webhook.php index 7271592c..a0b2c610 100644 --- a/src/MessageBird/Objects/Conversation/Webhook.php +++ b/src/MessageBird/Objects/Conversation/Webhook.php @@ -22,14 +22,14 @@ class Webhook extends Base implements JsonSerializable /** * A unique ID generated by the MessageBird platform that identifies this * webhook. - * + * * @var string */ public $id; /** * The URL of this webhook object. - * + * * @var string */ public $href; @@ -37,7 +37,7 @@ class Webhook extends Base implements JsonSerializable /** * The unique identifier for a MessageBird channel taht this webhook will * subscribe to events for. - * + * * @var string */ public $channelId; @@ -53,7 +53,7 @@ class Webhook extends Base implements JsonSerializable /** * The endpoint URL that requests are sent to. - * + * * @var string */ public $url; diff --git a/src/MessageBird/Objects/Group.php b/src/MessageBird/Objects/Group.php index 680f0a9b..201f2b3e 100644 --- a/src/MessageBird/Objects/Group.php +++ b/src/MessageBird/Objects/Group.php @@ -98,12 +98,12 @@ public function getUpdatedDatetime() * * @return $this|void */ - public function loadFromArray ($object) + public function loadFromArray($object) { parent::loadFromArray($object); if (!empty($object->items)) { - foreach($object->items AS &$item) { + foreach ($object->items as &$item) { $contact = new Contact(); $contact->loadFromArray($item); diff --git a/src/MessageBird/Objects/Message.php b/src/MessageBird/Objects/Message.php index 335754b8..6c60b9b9 100644 --- a/src/MessageBird/Objects/Message.php +++ b/src/MessageBird/Objects/Message.php @@ -221,12 +221,12 @@ public function getCreatedDatetime() * * @return $this|void */ - public function loadFromArray ($object) + public function loadFromArray($object) { parent::loadFromArray($object); if (!empty($this->recipients->items)) { - foreach($this->recipients->items AS &$item) { + foreach ($this->recipients->items as &$item) { $recipient = new Recipient(); $recipient->loadFromArray($item); diff --git a/src/MessageBird/Objects/MmsMessage.php b/src/MessageBird/Objects/MmsMessage.php index ff130d97..6895c395 100644 --- a/src/MessageBird/Objects/MmsMessage.php +++ b/src/MessageBird/Objects/MmsMessage.php @@ -7,7 +7,8 @@ * * @package MessageBird\Objects */ -class MmsMessage extends Base { +class MmsMessage extends Base +{ /** * An unique random ID which is created on the MessageBird @@ -97,7 +98,8 @@ class MmsMessage extends Base { * * @return string */ - public function getId() { + public function getId() + { return $this->id; } @@ -106,7 +108,8 @@ public function getId() { * * @return string */ - public function getHref() { + public function getHref() + { return $this->href; } @@ -115,7 +118,8 @@ public function getHref() { * * @return string */ - public function getCreatedDatetime() { + public function getCreatedDatetime() + { return $this->createdDatetime; } @@ -129,7 +133,7 @@ public function loadFromArray($object) parent::loadFromArray($object); if (!empty($this->recipients->items)) { - foreach($this->recipients->items as &$item) { + foreach ($this->recipients->items as &$item) { $recipient = new Recipient(); $recipient->loadFromArray($item); diff --git a/src/MessageBird/Objects/PartnerAccount/Account.php b/src/MessageBird/Objects/PartnerAccount/Account.php index f0345a65..538f6ccd 100644 --- a/src/MessageBird/Objects/PartnerAccount/Account.php +++ b/src/MessageBird/Objects/PartnerAccount/Account.php @@ -36,7 +36,7 @@ public function loadFromArray($object) return $this; } - foreach($this->accessKeys as &$item) { + foreach ($this->accessKeys as &$item) { $accessKey = new AccessKey(); $item = $accessKey->loadFromArray($item); } diff --git a/src/MessageBird/Objects/Voice/BaseList.php b/src/MessageBird/Objects/Voice/BaseList.php index 4be90765..031b8e72 100644 --- a/src/MessageBird/Objects/Voice/BaseList.php +++ b/src/MessageBird/Objects/Voice/BaseList.php @@ -11,7 +11,6 @@ */ class BaseList extends Base { - public $totalCount; public $pageCount; public $currentPage; diff --git a/src/MessageBird/Objects/Voice/Recording.php b/src/MessageBird/Objects/Voice/Recording.php index 9057324a..ef9292c2 100644 --- a/src/MessageBird/Objects/Voice/Recording.php +++ b/src/MessageBird/Objects/Voice/Recording.php @@ -95,6 +95,4 @@ public function getUpdatedAt() { return $this->updatedAt; } - - } diff --git a/src/MessageBird/Objects/VoiceMessage.php b/src/MessageBird/Objects/VoiceMessage.php index 643b9191..0583785a 100644 --- a/src/MessageBird/Objects/VoiceMessage.php +++ b/src/MessageBird/Objects/VoiceMessage.php @@ -151,12 +151,12 @@ public function getCreatedDatetime() * * @return $this|void */ - public function loadFromArray ($object) + public function loadFromArray($object) { parent::loadFromArray($object); if (!empty($this->recipients->items)) { - foreach($this->recipients->items AS &$item) { + foreach ($this->recipients->items as &$item) { $recipient = new Recipient(); $recipient->loadFromArray($item); diff --git a/src/MessageBird/Resources/AvailablePhoneNumbers.php b/src/MessageBird/Resources/AvailablePhoneNumbers.php index a04ecf5d..672371d6 100644 --- a/src/MessageBird/Resources/AvailablePhoneNumbers.php +++ b/src/MessageBird/Resources/AvailablePhoneNumbers.php @@ -84,4 +84,3 @@ private function processRequest($body): Objects\Number return (new Objects\Number())->loadFromArray($body->data[0]); } } -?> diff --git a/src/MessageBird/Resources/Base.php b/src/MessageBird/Resources/Base.php index 433816c3..2868d072 100644 --- a/src/MessageBird/Resources/Base.php +++ b/src/MessageBird/Resources/Base.php @@ -99,7 +99,7 @@ public function getList($parameters = []) $objectName = $this->object; - foreach ($items AS $item) { + foreach ($items as $item) { $object = new $objectName($this->httpClient); $message = $object->loadFromArray($item); diff --git a/src/MessageBird/Resources/Chat/Channel.php b/src/MessageBird/Resources/Chat/Channel.php index 7d6d6137..76369e21 100644 --- a/src/MessageBird/Resources/Chat/Channel.php +++ b/src/MessageBird/Resources/Chat/Channel.php @@ -19,7 +19,6 @@ class Channel extends Base */ public function __construct(Common\HttpClient $httpClient) { - $this->setObject(new Objects\Chat\Channel()); $this->setResourceName('channels'); diff --git a/src/MessageBird/Resources/Chat/Contact.php b/src/MessageBird/Resources/Chat/Contact.php index 090ac034..f7b4b4ab 100644 --- a/src/MessageBird/Resources/Chat/Contact.php +++ b/src/MessageBird/Resources/Chat/Contact.php @@ -19,7 +19,6 @@ class Contact extends Base */ public function __construct(Common\HttpClient $httpClient) { - $this->setObject(new Objects\Chat\Contact()); $this->setResourceName('contacts'); diff --git a/src/MessageBird/Resources/Chat/Message.php b/src/MessageBird/Resources/Chat/Message.php index 16d17a3f..6e36dd0a 100644 --- a/src/MessageBird/Resources/Chat/Message.php +++ b/src/MessageBird/Resources/Chat/Message.php @@ -19,7 +19,6 @@ class Message extends Base */ public function __construct(Common\HttpClient $httpClient) { - $this->setObject(new Objects\Chat\Message()); $this->setResourceName('messages'); diff --git a/src/MessageBird/Resources/Chat/Platform.php b/src/MessageBird/Resources/Chat/Platform.php index 9111904e..7a81c986 100644 --- a/src/MessageBird/Resources/Chat/Platform.php +++ b/src/MessageBird/Resources/Chat/Platform.php @@ -19,7 +19,6 @@ class Platform extends Base */ public function __construct(Common\HttpClient $httpClient) { - $this->setObject(new Objects\Chat\Platform()); $this->setResourceName('platforms'); diff --git a/src/MessageBird/Resources/Contacts.php b/src/MessageBird/Resources/Contacts.php index 3eb17ef8..678b7700 100644 --- a/src/MessageBird/Resources/Contacts.php +++ b/src/MessageBird/Resources/Contacts.php @@ -46,8 +46,12 @@ public function update($object, $id) $resourceName = $this->resourceName . ($id ? '/' . $id : null); $body = json_encode($body); - list(, , $body) = $this->httpClient->performHttpRequest(Common\HttpClient::REQUEST_PATCH, $resourceName, false, - $body); + list(, , $body) = $this->httpClient->performHttpRequest( + Common\HttpClient::REQUEST_PATCH, + $resourceName, + false, + $body + ); return $this->processRequest($body); } diff --git a/src/MessageBird/Resources/Conversation/Messages.php b/src/MessageBird/Resources/Conversation/Messages.php index c55035c9..10f94ee7 100644 --- a/src/MessageBird/Resources/Conversation/Messages.php +++ b/src/MessageBird/Resources/Conversation/Messages.php @@ -59,13 +59,13 @@ public function setObject($object) /** * Send a message to a conversation. - * + * * @param string $conversationId * @param Message $object * @param string[]|null $query * * @return Message - * + * * @throws HttpException * @throws RequestException * @throws ServerException @@ -87,7 +87,7 @@ public function create($conversationId, $object, $query = null) /** * Retrieves all the messages form the conversation based on its * conversationId. - * + * * @param string $conversationId * @param string[] $parameters */ @@ -123,7 +123,8 @@ public function getList($conversationId, $parameters = []) return $this->processRequest($body); } - public function read($messageId, $parameters = []) { + public function read($messageId, $parameters = []) + { list($status, , $body) = $this->httpClient->performHttpRequest( HttpClient::REQUEST_GET, sprintf(self::MESSAGE_RESOURCE_NAME, $messageId), @@ -148,9 +149,9 @@ public function read($messageId, $parameters = []) { /** * Formats a URL for the Conversation API's messages endpoint based on the * conversationId. - * + * * @param string $id - * + * * @return string */ private function getResourceNameWithId($id) @@ -160,7 +161,7 @@ private function getResourceNameWithId($id) /** * Throws an exception if the request if the request has any errors. - * + * * @param string $body * * @return self diff --git a/src/MessageBird/Resources/Lookup.php b/src/MessageBird/Resources/Lookup.php index a250d199..1e16ea71 100644 --- a/src/MessageBird/Resources/Lookup.php +++ b/src/MessageBird/Resources/Lookup.php @@ -37,7 +37,7 @@ public function __construct(Common\HttpClient $httpClient) */ public function read($phoneNumber = null, $countryCode = null) { - if(empty($phoneNumber)) { + if (empty($phoneNumber)) { throw new InvalidArgumentException('The phone number cannot be empty.'); } $query = null; diff --git a/src/MessageBird/Resources/LookupHlr.php b/src/MessageBird/Resources/LookupHlr.php index 489884ad..21e9fee8 100644 --- a/src/MessageBird/Resources/LookupHlr.php +++ b/src/MessageBird/Resources/LookupHlr.php @@ -37,7 +37,7 @@ public function __construct(Common\HttpClient $httpClient) */ public function create($hlr, $countryCode = null) { - if(empty($hlr->msisdn)) { + if (empty($hlr->msisdn)) { throw new InvalidArgumentException('The phone number ($hlr->msisdn) cannot be empty.'); } @@ -62,7 +62,7 @@ public function create($hlr, $countryCode = null) */ public function read($phoneNumber = null, $countryCode = null) { - if(empty($phoneNumber)) { + if (empty($phoneNumber)) { throw new InvalidArgumentException('The phone number cannot be empty.'); } @@ -74,6 +74,4 @@ public function read($phoneNumber = null, $countryCode = null) list(, , $body) = $this->httpClient->performHttpRequest(Common\HttpClient::REQUEST_GET, $resourceName, $query, null); return $this->processRequest($body); } - - } diff --git a/src/MessageBird/Resources/MmsMessages.php b/src/MessageBird/Resources/MmsMessages.php index 9d44230e..53f8e874 100644 --- a/src/MessageBird/Resources/MmsMessages.php +++ b/src/MessageBird/Resources/MmsMessages.php @@ -10,7 +10,8 @@ * * @package MessageBird\Resources */ -class MmsMessages extends Base { +class MmsMessages extends Base +{ /** * @param Common\HttpClient $httpClient diff --git a/src/MessageBird/Resources/PhoneNumbers.php b/src/MessageBird/Resources/PhoneNumbers.php index 70d44a27..ddba9da7 100644 --- a/src/MessageBird/Resources/PhoneNumbers.php +++ b/src/MessageBird/Resources/PhoneNumbers.php @@ -54,4 +54,3 @@ public function update($object, $id): Objects\Number return $this->processRequest($body); } } -?> diff --git a/src/MessageBird/Resources/Voice/CallFlows.php b/src/MessageBird/Resources/Voice/CallFlows.php index 4a2014b1..8496d0d0 100644 --- a/src/MessageBird/Resources/Voice/CallFlows.php +++ b/src/MessageBird/Resources/Voice/CallFlows.php @@ -18,7 +18,6 @@ class CallFlows extends Base */ public function __construct(Common\HttpClient $httpClient) { - $this->setObject(new Objects\Voice\CallFlow()); $this->setResourceName('call-flows'); diff --git a/src/MessageBird/Resources/Voice/Calls.php b/src/MessageBird/Resources/Voice/Calls.php index 382eb93f..7477dd69 100644 --- a/src/MessageBird/Resources/Voice/Calls.php +++ b/src/MessageBird/Resources/Voice/Calls.php @@ -18,7 +18,6 @@ class Calls extends Base */ public function __construct(Common\HttpClient $httpClient) { - $this->setObject(new Objects\Voice\Call()); $this->setResourceName('calls'); diff --git a/src/MessageBird/Resources/Voice/Transcriptions.php b/src/MessageBird/Resources/Voice/Transcriptions.php index cb51c6f5..7b558a68 100644 --- a/src/MessageBird/Resources/Voice/Transcriptions.php +++ b/src/MessageBird/Resources/Voice/Transcriptions.php @@ -113,8 +113,10 @@ public function getList($callId, $legId, $recordingId, $parameters = []) */ public function read($callId, $legId, $recordingId, $transcriptionId) { - list(, , $body) = $this->httpClient->performHttpRequest(Common\HttpClient::REQUEST_GET, - "calls/$callId/legs/$legId/recordings/$recordingId/transcriptions/$transcriptionId"); + list(, , $body) = $this->httpClient->performHttpRequest( + Common\HttpClient::REQUEST_GET, + "calls/$callId/legs/$legId/recordings/$recordingId/transcriptions/$transcriptionId" + ); return $this->processRequest($body); } @@ -129,8 +131,10 @@ public function read($callId, $legId, $recordingId, $transcriptionId) */ public function download($callId, $legId, $recordingId, $transcriptionId) { - list($status, , $body) = $this->httpClient->performHttpRequest(Common\HttpClient::REQUEST_GET, - "calls/$callId/legs/$legId/recordings/$recordingId/transcriptions/$transcriptionId.txt"); + list($status, , $body) = $this->httpClient->performHttpRequest( + Common\HttpClient::REQUEST_GET, + "calls/$callId/legs/$legId/recordings/$recordingId/transcriptions/$transcriptionId.txt" + ); if ($status !== 200) { return $this->processRequest($body); diff --git a/src/MessageBird/Resources/Voice/Webhooks.php b/src/MessageBird/Resources/Voice/Webhooks.php index e9bd7967..28585a18 100644 --- a/src/MessageBird/Resources/Voice/Webhooks.php +++ b/src/MessageBird/Resources/Voice/Webhooks.php @@ -18,7 +18,6 @@ class Webhooks extends Base */ public function __construct(Common\HttpClient $httpClient) { - $this->setObject(new Objects\Voice\Webhook()); $this->setResourceName('webhooks'); diff --git a/tests/Integration/Chat/ChatTest.php b/tests/Integration/Chat/ChatTest.php index f380a3fa..b4963269 100644 --- a/tests/Integration/Chat/ChatTest.php +++ b/tests/Integration/Chat/ChatTest.php @@ -21,8 +21,8 @@ public function testCreateChatMessage() public function testListChatMessage() { $this->expectException(\MessageBird\Exceptions\ServerException::class); - $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'messages', ['offset' => 100, 'limit' => 30], null); - $chatMessageList = $this->client->chatMessages->getList( ['offset' => 100, 'limit' => 30]); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'messages', ['offset' => 100, 'limit' => 30], null); + $chatMessageList = $this->client->chatMessages->getList(['offset' => 100, 'limit' => 30]); } public function testReadChatMessage() @@ -53,8 +53,8 @@ public function testCreateChatChannel() public function testListChatChannels() { $this->expectException(\MessageBird\Exceptions\ServerException::class); - $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'channels', ['offset' => 100, 'limit' => 30], null); - $channelList = $this->client->chatChannels->getList( ['offset' => 100, 'limit' => 30]); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'channels', ['offset' => 100, 'limit' => 30], null); + $channelList = $this->client->chatChannels->getList(['offset' => 100, 'limit' => 30]); } public function testReadChatChannel() @@ -79,14 +79,14 @@ public function testUpdateChatChannel() $this->mockClient->expects($this->atLeastOnce())->method('performHttpRequest')->willReturn([200, '', '{"name":"9d2345ac577e4f103cd3d4529856560","callbackUrl":"http:\/\/testurl.dev"}']); $this->mockClient->expects($this->once())->method('performHttpRequest')->with("PUT", 'channels/234agfgADFH2974gaADFH3hudf9h', null, '{"name":"9d2345ac577e4f103cd3d4529856560","callbackUrl":"http:\/\/testurl.dev"}'); - $this->client->chatChannels->update($chatChannel,'234agfgADFH2974gaADFH3hudf9h'); + $this->client->chatChannels->update($chatChannel, '234agfgADFH2974gaADFH3hudf9h'); } public function testListChatPlatforms() { $this->expectException(\MessageBird\Exceptions\ServerException::class); - $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'platforms', ['offset' => 100, 'limit' => 30], null); - $channelList = $this->client->chatPlatforms->getList( ['offset' => 100, 'limit' => 30]); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'platforms', ['offset' => 100, 'limit' => 30], null); + $channelList = $this->client->chatPlatforms->getList(['offset' => 100, 'limit' => 30]); } public function testReadChatPlatform() @@ -99,8 +99,8 @@ public function testReadChatPlatform() public function testListChatContacts() { $this->expectException(\MessageBird\Exceptions\ServerException::class); - $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'contacts', ['offset' => 100, 'limit' => 30], null); - $contactList = $this->client->chatContacts->getList( ['offset' => 100, 'limit' => 30]); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'contacts', ['offset' => 100, 'limit' => 30], null); + $contactList = $this->client->chatContacts->getList(['offset' => 100, 'limit' => 30]); } public function testReadChatContact() diff --git a/tests/Integration/Contacts/ContactTest.php b/tests/Integration/Contacts/ContactTest.php index 0370158d..7a29ed71 100644 --- a/tests/Integration/Contacts/ContactTest.php +++ b/tests/Integration/Contacts/ContactTest.php @@ -48,8 +48,8 @@ public function testCreateContact() public function testListContacts() { $this->expectException(\MessageBird\Exceptions\ServerException::class); - $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'contacts', ['offset' => 100, 'limit' => 30], null); - $this->client->contacts->getList( ['offset' => 100, 'limit' => 30]); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'contacts', ['offset' => 100, 'limit' => 30], null); + $this->client->contacts->getList(['offset' => 100, 'limit' => 30]); } public function testViewContact() @@ -70,7 +70,10 @@ public function testContactGetGroups() { $this->mockClient->method('performHttpRequest') ->with( - $this->equalTo(\MessageBird\Common\HttpClient::REQUEST_GET), $this->equalTo('contacts/contact_id/groups'), $this->anything(), $this->anything() + $this->equalTo(\MessageBird\Common\HttpClient::REQUEST_GET), + $this->equalTo('contacts/contact_id/groups'), + $this->anything(), + $this->anything() ) ->willReturn([ 200, @@ -112,7 +115,10 @@ public function testContactGetMessages() { $this->mockClient->method('performHttpRequest') ->with( - $this->equalTo(\MessageBird\Common\HttpClient::REQUEST_GET), $this->equalTo('contacts/contact_id/messages'), $this->anything(), $this->anything() + $this->equalTo(\MessageBird\Common\HttpClient::REQUEST_GET), + $this->equalTo('contacts/contact_id/messages'), + $this->anything(), + $this->anything() ) ->willReturn([ 200, @@ -121,6 +127,7 @@ public function testContactGetMessages() ]); $messages = $this->client->contacts->getMessages("contact_id"); + foreach($messages->items as $message) { $this->assertInstanceOf(Message::class, $message); } diff --git a/tests/Integration/Conversation/ConversationContentTest.php b/tests/Integration/Conversation/ConversationContentTest.php index b5327691..c12811c4 100644 --- a/tests/Integration/Conversation/ConversationContentTest.php +++ b/tests/Integration/Conversation/ConversationContentTest.php @@ -13,7 +13,7 @@ class ConversationContentTest extends BaseTest { /** * @param string $json - * + * * @return Message */ private function messageFromJson($json) @@ -50,7 +50,7 @@ public function testFileContent() $message->type = 'file'; $this->assertEquals($message, $this->messageFromJson( - '{"type":"file","content":{"file":{"url":"https://example.com/file.pdf"}}}' + '{"type":"file","content":{"file":{"url":"https://example.com/file.pdf"}}}' )); } diff --git a/tests/Integration/Groups/GroupTest.php b/tests/Integration/Groups/GroupTest.php index 23af07cb..4d406b58 100644 --- a/tests/Integration/Groups/GroupTest.php +++ b/tests/Integration/Groups/GroupTest.php @@ -29,8 +29,8 @@ public function testCreateGroup() public function testListGroups() { $this->expectException(\MessageBird\Exceptions\ServerException::class); - $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'groups', ['offset' => 100, 'limit' => 30], null); - $this->client->groups->getList( ['offset' => 100, 'limit' => 30]); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'groups', ['offset' => 100, 'limit' => 30], null); + $this->client->groups->getList(['offset' => 100, 'limit' => 30]); } public function testViewGroup() diff --git a/tests/Integration/Lookup/LookupTest.php b/tests/Integration/Lookup/LookupTest.php index b31a26fe..d422b2f7 100644 --- a/tests/Integration/Lookup/LookupTest.php +++ b/tests/Integration/Lookup/LookupTest.php @@ -81,5 +81,4 @@ public function testReadLookupHlrWithCountryCode() $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'lookup/612345678/hlr', $params, null); $this->client->lookupHlr->read(612345678, $params["countryCode"]); } - } diff --git a/tests/Integration/Messages/MessagesTest.php b/tests/Integration/Messages/MessagesTest.php index 243df5a6..234ae345 100644 --- a/tests/Integration/Messages/MessagesTest.php +++ b/tests/Integration/Messages/MessagesTest.php @@ -91,8 +91,8 @@ public function testFlashSmsMessage() public function testListMessage() { $this->expectException(\MessageBird\Exceptions\ServerException::class); - $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'messages', ['offset' => 100, 'limit' => 30], null); - $this->client->messages->getList( ['offset' => 100, 'limit' => 30]); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'messages', ['offset' => 100, 'limit' => 30], null); + $this->client->messages->getList(['offset' => 100, 'limit' => 30]); } public function testReadMessage() diff --git a/tests/Integration/Mms/MmsTest.php b/tests/Integration/Mms/MmsTest.php index 57619408..211a9c85 100644 --- a/tests/Integration/Mms/MmsTest.php +++ b/tests/Integration/Mms/MmsTest.php @@ -64,7 +64,6 @@ public function testListMms() $this->assertCount(2, $resultMessages->items); $this->assertMessagesAreEqual($dummyMessage, $resultMessages->items[0], 'message_id'); $this->assertMessagesAreEqual($dummyMessage, $resultMessages->items[1], 'message_id_2'); - } public function testDeleteMms() @@ -135,7 +134,7 @@ private function assertMessagesAreEqual(\MessageBird\Objects\MmsMessage $mmsMess $this->assertAttributeEquals($mmsMessage->mediaUrls, 'mediaUrls', $resultMmsMessage); $this->assertAttributeEquals($mmsMessage->reference, 'reference', $resultMmsMessage); - foreach($resultMmsMessage->recipients->items as $item) { + foreach ($resultMmsMessage->recipients->items as $item) { $this->assertArraySubset([$item->recipient], $mmsMessage->recipients); } } diff --git a/tests/Integration/Numbers/AvailablePhoneNumbersTest.php b/tests/Integration/Numbers/AvailablePhoneNumbersTest.php index d3c67947..17739337 100644 --- a/tests/Integration/Numbers/AvailablePhoneNumbersTest.php +++ b/tests/Integration/Numbers/AvailablePhoneNumbersTest.php @@ -9,7 +9,7 @@ class AvailablePhoneNumbersTest extends BaseTest public function testListAvailablePhoneNumbers() { $this->expectException(\MessageBird\Exceptions\ServerException::class); - $this->mockClient->expects($this->once())->method('performHttpRequest')->with('GET', 'available-phone-numbers/nl', [], null); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with('GET', 'available-phone-numbers/nl', [], null); $this->client->availablePhoneNumbers->getList("nl", []); } } diff --git a/tests/Integration/Numbers/PhoneNumbersTest.php b/tests/Integration/Numbers/PhoneNumbersTest.php index a94253c1..333bce1c 100644 --- a/tests/Integration/Numbers/PhoneNumbersTest.php +++ b/tests/Integration/Numbers/PhoneNumbersTest.php @@ -16,7 +16,7 @@ public function testReadPhoneNumber() public function testListPhoneNumbers() { $this->expectException(\MessageBird\Exceptions\ServerException::class); - $this->mockClient->expects($this->once())->method('performHttpRequest')->with('GET', 'phone-numbers', [], null); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with('GET', 'phone-numbers', [], null); $this->client->phoneNumbers->getList(); } diff --git a/tests/Integration/PartnerAccount/AccountTest.php b/tests/Integration/PartnerAccount/AccountTest.php index fc8b058a..2de89bd8 100644 --- a/tests/Integration/PartnerAccount/AccountTest.php +++ b/tests/Integration/PartnerAccount/AccountTest.php @@ -168,6 +168,6 @@ public function testEditSubAccount() }' ]); - $this->client->partnerAccounts->update($account,1); + $this->client->partnerAccounts->update($account, 1); } } diff --git a/tests/Integration/Voice/VoiceTest.php b/tests/Integration/Voice/VoiceTest.php index 27d247b9..20e31422 100644 --- a/tests/Integration/Voice/VoiceTest.php +++ b/tests/Integration/Voice/VoiceTest.php @@ -93,9 +93,9 @@ public function testReadVoiceRecording() public function testDeleteVoiceRecording() { - $this->expectException(\MessageBird\Exceptions\ServerException::class); - $this->mockClient->expects($this->atLeastOnce())->method('performHttpRequest')->willReturn([204, '', null]); - $this->client->voiceRecordings->delete('foo','bar','baz'); + $this->expectException(\MessageBird\Exceptions\ServerException::class); + $this->mockClient->expects($this->atLeastOnce())->method('performHttpRequest')->willReturn([204, '', null]); + $this->client->voiceRecordings->delete('foo', 'bar', 'baz'); } diff --git a/tests/Integration/VoiceMessages/VoiceMessagesTest.php b/tests/Integration/VoiceMessages/VoiceMessagesTest.php index db33c898..58cfcb9d 100644 --- a/tests/Integration/VoiceMessages/VoiceMessagesTest.php +++ b/tests/Integration/VoiceMessages/VoiceMessagesTest.php @@ -22,8 +22,8 @@ public function testVoiceMessageCreate() public function testListMessage() { $this->expectException(\MessageBird\Exceptions\ServerException::class); - $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'voicemessages', ['offset' => 100, 'limit' => 30], null); - $this->client->voicemessages->getList( ['offset' => 100, 'limit' => 30]); + $this->mockClient->expects($this->once())->method('performHttpRequest')->with("GET", 'voicemessages', ['offset' => 100, 'limit' => 30], null); + $this->client->voicemessages->getList(['offset' => 100, 'limit' => 30]); } public function testReadMessage()