Skip to content

Enforce PSR-2 syntax. #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions examples/available-phone-numbers-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());

}
?>
3 changes: 0 additions & 3 deletions examples/balance-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());

}
2 changes: 0 additions & 2 deletions examples/chatchannels-create.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 0 additions & 2 deletions examples/chatchannels-delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 0 additions & 2 deletions examples/chatchannels-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 0 additions & 2 deletions examples/chatchannels-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 0 additions & 2 deletions examples/chatchannels-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 0 additions & 2 deletions examples/chatcontacts-delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 0 additions & 2 deletions examples/chatcontacts-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 0 additions & 2 deletions examples/chatcontacts-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
3 changes: 0 additions & 3 deletions examples/chatmessages-create.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 0 additions & 2 deletions examples/chatmessages-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 0 additions & 2 deletions examples/chatmessages-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 0 additions & 2 deletions examples/chatplatforms-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 0 additions & 2 deletions examples/contact-create.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
3 changes: 0 additions & 3 deletions examples/contact-delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());

}
2 changes: 0 additions & 2 deletions examples/contact-get-groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
2 changes: 0 additions & 2 deletions examples/contact-get-messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
4 changes: 1 addition & 3 deletions examples/contact-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
2 changes: 0 additions & 2 deletions examples/contact-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 0 additions & 2 deletions examples/contact-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
2 changes: 1 addition & 1 deletion examples/conversations/enable-whatsapp-sandbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 0 additions & 2 deletions examples/group-add-contact-to-group.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
2 changes: 0 additions & 2 deletions examples/group-create.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
3 changes: 0 additions & 3 deletions examples/group-delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());

}
2 changes: 0 additions & 2 deletions examples/group-get-contacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
4 changes: 1 addition & 3 deletions examples/group-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
2 changes: 0 additions & 2 deletions examples/group-remove-contact-from-group.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
2 changes: 0 additions & 2 deletions examples/group-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 0 additions & 2 deletions examples/group-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
4 changes: 0 additions & 4 deletions examples/hlr-create.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

}
Loading