Skip to content

Commit 16a5365

Browse files
authored
Init DynamoDb (#314)
* Init DynamoDb * Dont check if arrays are null * Revert minor change to reduce the diff * fixed tests * Fixed more tests * Bugfix, make sure child objects is checked before used. * Generate * Solve the date issue * Update composer.json
1 parent 907f8e3 commit 16a5365

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Result/ListLayerVersionsResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ protected function populateResult(ResponseInterface $response, HttpClientInterfa
112112
$data = $response->toArray(false);
113113

114114
$this->NextMarker = isset($data['NextMarker']) ? (string) $data['NextMarker'] : null;
115-
$this->LayerVersions = !$data['LayerVersions'] ? [] : (function (array $json): array {
115+
$this->LayerVersions = empty($data['LayerVersions']) ? [] : (function (array $json): array {
116116
$items = [];
117117
foreach ($json as $item) {
118118
$items[] = new LayerVersionsListItem([
119119
'LayerVersionArn' => isset($item['LayerVersionArn']) ? (string) $item['LayerVersionArn'] : null,
120120
'Version' => isset($item['Version']) ? (string) $item['Version'] : null,
121121
'Description' => isset($item['Description']) ? (string) $item['Description'] : null,
122122
'CreatedDate' => isset($item['CreatedDate']) ? (string) $item['CreatedDate'] : null,
123-
'CompatibleRuntimes' => !$item['CompatibleRuntimes'] ? [] : (function (array $json): array {
123+
'CompatibleRuntimes' => empty($item['CompatibleRuntimes']) ? [] : (function (array $json): array {
124124
$items = [];
125125
foreach ($json as $item) {
126126
$a = isset($item) ? (string) $item : null;

src/Result/PublishLayerVersionResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ protected function populateResult(ResponseInterface $response, HttpClientInterfa
115115
{
116116
$data = $response->toArray(false);
117117

118-
$this->Content = new LayerVersionContentOutput([
118+
$this->Content = empty($data['Content']) ? null : new LayerVersionContentOutput([
119119
'Location' => isset($data['Content']['Location']) ? (string) $data['Content']['Location'] : null,
120120
'CodeSha256' => isset($data['Content']['CodeSha256']) ? (string) $data['Content']['CodeSha256'] : null,
121121
'CodeSize' => isset($data['Content']['CodeSize']) ? (string) $data['Content']['CodeSize'] : null,
@@ -125,7 +125,7 @@ protected function populateResult(ResponseInterface $response, HttpClientInterfa
125125
$this->Description = isset($data['Description']) ? (string) $data['Description'] : null;
126126
$this->CreatedDate = isset($data['CreatedDate']) ? (string) $data['CreatedDate'] : null;
127127
$this->Version = isset($data['Version']) ? (string) $data['Version'] : null;
128-
$this->CompatibleRuntimes = !$data['CompatibleRuntimes'] ? [] : (function (array $json): array {
128+
$this->CompatibleRuntimes = empty($data['CompatibleRuntimes']) ? [] : (function (array $json): array {
129129
$items = [];
130130
foreach ($json as $item) {
131131
$a = isset($item) ? (string) $item : null;

0 commit comments

Comments
 (0)