Skip to content

Commit

Permalink
Work around where empty lists are missing from responses (#1621)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell authored Dec 8, 2023
1 parent 5fcd024 commit 692f98c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Result/GetRecordsOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected function populateResult(Response $response): void
{
$data = $response->toArray();

$this->records = $this->populateResultRecordList($data['Records']);
$this->records = $this->populateResultRecordList($data['Records'] ?? []);
$this->nextShardIterator = isset($data['NextShardIterator']) ? (string) $data['NextShardIterator'] : null;
$this->millisBehindLatest = isset($data['MillisBehindLatest']) ? (int) $data['MillisBehindLatest'] : null;
$this->childShards = empty($data['ChildShards']) ? [] : $this->populateResultChildShardList($data['ChildShards']);
Expand Down
2 changes: 1 addition & 1 deletion src/Result/ListStreamsOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ protected function populateResult(Response $response): void
{
$data = $response->toArray();

$this->streamNames = $this->populateResultStreamNameList($data['StreamNames']);
$this->streamNames = $this->populateResultStreamNameList($data['StreamNames'] ?? []);
$this->hasMoreStreams = filter_var($data['HasMoreStreams'], \FILTER_VALIDATE_BOOLEAN);
$this->nextToken = isset($data['NextToken']) ? (string) $data['NextToken'] : null;
$this->streamSummaries = empty($data['StreamSummaries']) ? [] : $this->populateResultStreamSummaryList($data['StreamSummaries']);
Expand Down
2 changes: 1 addition & 1 deletion src/Result/ListTagsForStreamOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function populateResult(Response $response): void
{
$data = $response->toArray();

$this->tags = $this->populateResultTagList($data['Tags']);
$this->tags = $this->populateResultTagList($data['Tags'] ?? []);
$this->hasMoreTags = filter_var($data['HasMoreTags'], \FILTER_VALIDATE_BOOLEAN);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Result/PutRecordsOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function populateResult(Response $response): void
$data = $response->toArray();

$this->failedRecordCount = isset($data['FailedRecordCount']) ? (int) $data['FailedRecordCount'] : null;
$this->records = $this->populateResultPutRecordsResultEntryList($data['Records']);
$this->records = $this->populateResultPutRecordsResultEntryList($data['Records'] ?? []);
$this->encryptionType = isset($data['EncryptionType']) ? (string) $data['EncryptionType'] : null;
}

Expand Down

0 comments on commit 692f98c

Please sign in to comment.