Skip to content

Commit d4d73c6

Browse files
author
Alexander Timmermann
authored
Revert #103: breaks BC (#126)
* fix: revert "Created Recipients object rather than it being a stdClass (#103)" This reverts commit 0b39ffd. * chore: bump version to 1.19.2
1 parent a365e32 commit d4d73c6

File tree

4 files changed

+11
-126
lines changed

4 files changed

+11
-126
lines changed

src/MessageBird/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Client
1919
const ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX = 'ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX';
2020
const CONVERSATIONSAPI_WHATSAPP_SANDBOX_ENDPOINT = 'https://whatsapp-sandbox.messagebird.com/v1';
2121

22-
const CLIENT_VERSION = '1.19.1';
22+
const CLIENT_VERSION = '1.19.2';
2323

2424
/**
2525
* @var string

src/MessageBird/Objects/Message.php

+10-4
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ class Message extends Base
127127
/**
128128
* An array of recipients
129129
*
130-
* @var Recipients
130+
* @var array
131131
*/
132-
public $recipients;
132+
public $recipients = array ();
133133

134134
/**
135135
* The URL to send status delivery reports for the message to
@@ -225,8 +225,14 @@ public function loadFromArray ($object)
225225
{
226226
parent::loadFromArray($object);
227227

228-
$recipients = new Recipients();
229-
$this->recipients = $recipients->loadFromArray($this->recipients);
228+
if (!empty($this->recipients->items)) {
229+
foreach($this->recipients->items AS &$item) {
230+
$Recipient = new Recipient();
231+
$Recipient->loadFromArray($item);
232+
233+
$item = $Recipient;
234+
}
235+
}
230236

231237
return $this;
232238
}

src/MessageBird/Objects/Recipient.php

-24
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,4 @@ class Recipient extends Base
3535
* @var string
3636
*/
3737
public $statusDatetime;
38-
39-
/**
40-
* @return int
41-
*/
42-
public function getRecipient()
43-
{
44-
return $this->recipient;
45-
}
46-
47-
/**
48-
* @return string
49-
*/
50-
public function getStatus()
51-
{
52-
return $this->status;
53-
}
54-
55-
/**
56-
* @return string
57-
*/
58-
public function getStatusDatetime()
59-
{
60-
return $this->statusDatetime;
61-
}
6238
}

src/MessageBird/Objects/Recipients.php

-97
This file was deleted.

0 commit comments

Comments
 (0)