Skip to content

Commit a6de9c0

Browse files
Work around where empty lists are missing from responses (#1621)
1 parent c010d66 commit a6de9c0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Result/ChangeMessageVisibilityBatchResult.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ protected function populateResult(Response $response): void
5151
{
5252
$data = $response->toArray();
5353

54-
$this->successful = $this->populateResultChangeMessageVisibilityBatchResultEntryList($data['Successful']);
55-
$this->failed = $this->populateResultBatchResultErrorEntryList($data['Failed']);
54+
$this->successful = $this->populateResultChangeMessageVisibilityBatchResultEntryList($data['Successful'] ?? []);
55+
$this->failed = $this->populateResultBatchResultErrorEntryList($data['Failed'] ?? []);
5656
}
5757

5858
private function populateResultBatchResultErrorEntry(array $json): BatchResultErrorEntry

src/Result/DeleteMessageBatchResult.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ protected function populateResult(Response $response): void
5151
{
5252
$data = $response->toArray();
5353

54-
$this->successful = $this->populateResultDeleteMessageBatchResultEntryList($data['Successful']);
55-
$this->failed = $this->populateResultBatchResultErrorEntryList($data['Failed']);
54+
$this->successful = $this->populateResultDeleteMessageBatchResultEntryList($data['Successful'] ?? []);
55+
$this->failed = $this->populateResultBatchResultErrorEntryList($data['Failed'] ?? []);
5656
}
5757

5858
private function populateResultBatchResultErrorEntry(array $json): BatchResultErrorEntry

src/Result/SendMessageBatchResult.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ protected function populateResult(Response $response): void
5151
{
5252
$data = $response->toArray();
5353

54-
$this->successful = $this->populateResultSendMessageBatchResultEntryList($data['Successful']);
55-
$this->failed = $this->populateResultBatchResultErrorEntryList($data['Failed']);
54+
$this->successful = $this->populateResultSendMessageBatchResultEntryList($data['Successful'] ?? []);
55+
$this->failed = $this->populateResultBatchResultErrorEntryList($data['Failed'] ?? []);
5656
}
5757

5858
private function populateResultBatchResultErrorEntry(array $json): BatchResultErrorEntry

0 commit comments

Comments
 (0)