Skip to content

Commit e0d6446

Browse files
author
Alexandru Bucur
authored
Merge pull request #140 from lucasmichot/feature/short-array-syntax
Enforce the usage of the short array syntax.
2 parents 7fcda3b + ca7bad7 commit e0d6446

File tree

83 files changed

+299
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+299
-299
lines changed

examples/available-phone-numbers-view.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
$MessageBird = new \MessageBird\Client('MESSAGEBIRD_API_KEY');
66

77
try {
8-
$phoneNumbers = $MessageBird->availablePhoneNumbers->getList("nl", array());
8+
$phoneNumbers = $MessageBird->availablePhoneNumbers->getList("nl", []);
99
var_dump($phoneNumbers);
1010

1111
} catch (\MessageBird\Exceptions\AuthenticateException $e) {

examples/chatchannels-create.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
// are required when creating a channel for this platform.
1616

1717
$ChatChannel->channelDetails =
18-
array(
18+
[
1919
'botName' => 'testBot',
2020
'token' => '1234566778:A34JT44Yr4amk234352et5hvRnHeAEHA'
21-
);
21+
];
2222

2323
try {
2424
$ChatChannelResult = $MessageBird->chatChannels->create($ChatChannel);

examples/contact-list.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
$MessageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here.
66

77
try {
8-
$ContactList = $MessageBird->contacts->getList(array ());
8+
$ContactList = $MessageBird->contacts->getList( []);
99
var_dump($ContactList);
1010

1111
} catch (\MessageBird\Exceptions\AuthenticateException $e) {

examples/conversations/create-hsm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
$hsm = new \MessageBird\Objects\Conversation\HSM\Message();
2121
$hsm->templateName = 'YOUR TEMPLATE NAME';
2222
$hsm->namespace = 'YOUR NAMESPACE';
23-
$hsm->params = array($hsmParam1, $hsmParam2);
23+
$hsm->params = [$hsmParam1, $hsmParam2];
2424
$hsm->language = $hsmLanguage;
2525

2626
$content = new \MessageBird\Objects\Conversation\Content();

examples/conversations/list.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
$messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here.
99

1010
// Take 10 objects, but skip the first 5.
11-
$optionalParameters = array(
11+
$optionalParameters = [
1212
'limit' => '10',
1313
'offset' => '5',
14-
);
14+
];
1515

1616
try {
1717
$conversations = $messageBird->conversations->getList($optionalParameters);

examples/conversations/messages-create-location.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
$messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here.
88

99
$content = new \MessageBird\Objects\Conversation\Content();
10-
$content->location = array(
10+
$content->location = [
1111
'latitude' => 52.379112,
1212
'longitude' => 4.900384,
13-
);
13+
];
1414

1515
$message = new \MessageBird\Objects\Conversation\Message();
1616
$message->channelId = 'CHANNEL_ID';

examples/conversations/messages-create-media.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
$messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here.
99

1010
$content = new \MessageBird\Objects\Conversation\Content();
11-
$content->image = array(
11+
$content->image = [
1212
'url' => 'https://cdn-gc.messagebird.com/assets/images/logo.png'
13-
);
13+
];
1414

1515
$message = new \MessageBird\Objects\Conversation\Message();
1616
$message->channelId = 'CHANNEL_ID';

examples/conversations/read.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
// Setting the optional 'include' parameter to 'content' requests the API to
1010
// include the expanded Contact object in its response. Excluded by default.
11-
$optionalParameters = array(
11+
$optionalParameters = [
1212
'include' => 'content',
13-
);
13+
];
1414

1515
try {
1616
$conversation = $messageBird->conversations->read(

examples/conversations/webhooks-create.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
$webhook = new \MessageBird\Objects\Conversation\Webhook();
1414
$webhook->channelId = 'CHANNEL_ID';
1515
$webhook->url = 'https://example.com/webhook';
16-
$webhook->events = array(
16+
$webhook->events = [
1717
\MessageBird\Objects\Conversation\Webhook::EVENT_CONVERSATION_CREATED,
1818
\MessageBird\Objects\Conversation\Webhook::EVENT_MESSAGE_CREATED,
1919

2020
// Other options:
2121
// \MessageBird\Objects\Conversation\Webhook::EVENT_CONVERSATION_UPDATED,
2222
// \MessageBird\Objects\Conversation\Webhook::EVENT_MESSAGE_UPDATED,
23-
);
23+
];
2424

2525
$messageBird->conversationWebhooks->create($webhook);
2626
} catch (\Exception $e) {

examples/group-add-contact-to-group.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
$MessageBird = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Set your own API access key here.
66

77
try {
8-
$contacts['ids'] = array(
8+
$contacts['ids'] = [
99
'contact_id_1',
1010
'contact_id_2',
11-
);
11+
];
1212
$group_id = 'group_id';
1313
$GroupAddContact = $MessageBird->groups->addContacts($contacts, $group_id);
1414
var_dump($GroupAddContact);

0 commit comments

Comments
 (0)