@@ -42,9 +42,9 @@ protected function populateResult(Response $response): void
42
42
$ data = $ response ->toArray ();
43
43
44
44
$ this ->tableDescription = empty ($ data ['TableDescription ' ]) ? null : new TableDescription ([
45
- 'AttributeDefinitions ' => empty ($ data ['TableDescription ' ]['AttributeDefinitions ' ]) ? [] : $ this ->populateResultAttributeDefinitions ($ data ['TableDescription ' ]['AttributeDefinitions ' ]),
45
+ 'AttributeDefinitions ' => ! isset ($ data ['TableDescription ' ]['AttributeDefinitions ' ]) ? null : $ this ->populateResultAttributeDefinitions ($ data ['TableDescription ' ]['AttributeDefinitions ' ]),
46
46
'TableName ' => isset ($ data ['TableDescription ' ]['TableName ' ]) ? (string ) $ data ['TableDescription ' ]['TableName ' ] : null ,
47
- 'KeySchema ' => empty ($ data ['TableDescription ' ]['KeySchema ' ]) ? [] : $ this ->populateResultKeySchema ($ data ['TableDescription ' ]['KeySchema ' ]),
47
+ 'KeySchema ' => ! isset ($ data ['TableDescription ' ]['KeySchema ' ]) ? null : $ this ->populateResultKeySchema ($ data ['TableDescription ' ]['KeySchema ' ]),
48
48
'TableStatus ' => isset ($ data ['TableDescription ' ]['TableStatus ' ]) ? (string ) $ data ['TableDescription ' ]['TableStatus ' ] : null ,
49
49
'CreationDateTime ' => (isset ($ data ['TableDescription ' ]['CreationDateTime ' ]) && ($ d = \DateTimeImmutable::createFromFormat ('U.u ' , sprintf ('%.6F ' , $ data ['TableDescription ' ]['CreationDateTime ' ])))) ? $ d : null ,
50
50
'ProvisionedThroughput ' => empty ($ data ['TableDescription ' ]['ProvisionedThroughput ' ]) ? null : new ProvisionedThroughputDescription ([
@@ -62,16 +62,16 @@ protected function populateResult(Response $response): void
62
62
'BillingMode ' => isset ($ data ['TableDescription ' ]['BillingModeSummary ' ]['BillingMode ' ]) ? (string ) $ data ['TableDescription ' ]['BillingModeSummary ' ]['BillingMode ' ] : null ,
63
63
'LastUpdateToPayPerRequestDateTime ' => (isset ($ data ['TableDescription ' ]['BillingModeSummary ' ]['LastUpdateToPayPerRequestDateTime ' ]) && ($ d = \DateTimeImmutable::createFromFormat ('U.u ' , sprintf ('%.6F ' , $ data ['TableDescription ' ]['BillingModeSummary ' ]['LastUpdateToPayPerRequestDateTime ' ])))) ? $ d : null ,
64
64
]),
65
- 'LocalSecondaryIndexes ' => empty ($ data ['TableDescription ' ]['LocalSecondaryIndexes ' ]) ? [] : $ this ->populateResultLocalSecondaryIndexDescriptionList ($ data ['TableDescription ' ]['LocalSecondaryIndexes ' ]),
66
- 'GlobalSecondaryIndexes ' => empty ($ data ['TableDescription ' ]['GlobalSecondaryIndexes ' ]) ? [] : $ this ->populateResultGlobalSecondaryIndexDescriptionList ($ data ['TableDescription ' ]['GlobalSecondaryIndexes ' ]),
65
+ 'LocalSecondaryIndexes ' => ! isset ($ data ['TableDescription ' ]['LocalSecondaryIndexes ' ]) ? null : $ this ->populateResultLocalSecondaryIndexDescriptionList ($ data ['TableDescription ' ]['LocalSecondaryIndexes ' ]),
66
+ 'GlobalSecondaryIndexes ' => ! isset ($ data ['TableDescription ' ]['GlobalSecondaryIndexes ' ]) ? null : $ this ->populateResultGlobalSecondaryIndexDescriptionList ($ data ['TableDescription ' ]['GlobalSecondaryIndexes ' ]),
67
67
'StreamSpecification ' => empty ($ data ['TableDescription ' ]['StreamSpecification ' ]) ? null : new StreamSpecification ([
68
68
'StreamEnabled ' => filter_var ($ data ['TableDescription ' ]['StreamSpecification ' ]['StreamEnabled ' ], \FILTER_VALIDATE_BOOLEAN ),
69
69
'StreamViewType ' => isset ($ data ['TableDescription ' ]['StreamSpecification ' ]['StreamViewType ' ]) ? (string ) $ data ['TableDescription ' ]['StreamSpecification ' ]['StreamViewType ' ] : null ,
70
70
]),
71
71
'LatestStreamLabel ' => isset ($ data ['TableDescription ' ]['LatestStreamLabel ' ]) ? (string ) $ data ['TableDescription ' ]['LatestStreamLabel ' ] : null ,
72
72
'LatestStreamArn ' => isset ($ data ['TableDescription ' ]['LatestStreamArn ' ]) ? (string ) $ data ['TableDescription ' ]['LatestStreamArn ' ] : null ,
73
73
'GlobalTableVersion ' => isset ($ data ['TableDescription ' ]['GlobalTableVersion ' ]) ? (string ) $ data ['TableDescription ' ]['GlobalTableVersion ' ] : null ,
74
- 'Replicas ' => empty ($ data ['TableDescription ' ]['Replicas ' ]) ? [] : $ this ->populateResultReplicaDescriptionList ($ data ['TableDescription ' ]['Replicas ' ]),
74
+ 'Replicas ' => ! isset ($ data ['TableDescription ' ]['Replicas ' ]) ? null : $ this ->populateResultReplicaDescriptionList ($ data ['TableDescription ' ]['Replicas ' ]),
75
75
'RestoreSummary ' => empty ($ data ['TableDescription ' ]['RestoreSummary ' ]) ? null : new RestoreSummary ([
76
76
'SourceBackupArn ' => isset ($ data ['TableDescription ' ]['RestoreSummary ' ]['SourceBackupArn ' ]) ? (string ) $ data ['TableDescription ' ]['RestoreSummary ' ]['SourceBackupArn ' ] : null ,
77
77
'SourceTableArn ' => isset ($ data ['TableDescription ' ]['RestoreSummary ' ]['SourceTableArn ' ]) ? (string ) $ data ['TableDescription ' ]['RestoreSummary ' ]['SourceTableArn ' ] : null ,
@@ -117,10 +117,10 @@ private function populateResultGlobalSecondaryIndexDescriptionList(array $json):
117
117
foreach ($ json as $ item ) {
118
118
$ items [] = new GlobalSecondaryIndexDescription ([
119
119
'IndexName ' => isset ($ item ['IndexName ' ]) ? (string ) $ item ['IndexName ' ] : null ,
120
- 'KeySchema ' => empty ($ item ['KeySchema ' ]) ? [] : $ this ->populateResultKeySchema ($ item ['KeySchema ' ]),
120
+ 'KeySchema ' => ! isset ($ item ['KeySchema ' ]) ? null : $ this ->populateResultKeySchema ($ item ['KeySchema ' ]),
121
121
'Projection ' => empty ($ item ['Projection ' ]) ? null : new Projection ([
122
122
'ProjectionType ' => isset ($ item ['Projection ' ]['ProjectionType ' ]) ? (string ) $ item ['Projection ' ]['ProjectionType ' ] : null ,
123
- 'NonKeyAttributes ' => empty ($ item ['Projection ' ]['NonKeyAttributes ' ]) ? [] : $ this ->populateResultNonKeyAttributeNameList ($ item ['Projection ' ]['NonKeyAttributes ' ]),
123
+ 'NonKeyAttributes ' => ! isset ($ item ['Projection ' ]['NonKeyAttributes ' ]) ? null : $ this ->populateResultNonKeyAttributeNameList ($ item ['Projection ' ]['NonKeyAttributes ' ]),
124
124
]),
125
125
'IndexStatus ' => isset ($ item ['IndexStatus ' ]) ? (string ) $ item ['IndexStatus ' ] : null ,
126
126
'Backfilling ' => isset ($ item ['Backfilling ' ]) ? filter_var ($ item ['Backfilling ' ], \FILTER_VALIDATE_BOOLEAN ) : null ,
@@ -165,10 +165,10 @@ private function populateResultLocalSecondaryIndexDescriptionList(array $json):
165
165
foreach ($ json as $ item ) {
166
166
$ items [] = new LocalSecondaryIndexDescription ([
167
167
'IndexName ' => isset ($ item ['IndexName ' ]) ? (string ) $ item ['IndexName ' ] : null ,
168
- 'KeySchema ' => empty ($ item ['KeySchema ' ]) ? [] : $ this ->populateResultKeySchema ($ item ['KeySchema ' ]),
168
+ 'KeySchema ' => ! isset ($ item ['KeySchema ' ]) ? null : $ this ->populateResultKeySchema ($ item ['KeySchema ' ]),
169
169
'Projection ' => empty ($ item ['Projection ' ]) ? null : new Projection ([
170
170
'ProjectionType ' => isset ($ item ['Projection ' ]['ProjectionType ' ]) ? (string ) $ item ['Projection ' ]['ProjectionType ' ] : null ,
171
- 'NonKeyAttributes ' => empty ($ item ['Projection ' ]['NonKeyAttributes ' ]) ? [] : $ this ->populateResultNonKeyAttributeNameList ($ item ['Projection ' ]['NonKeyAttributes ' ]),
171
+ 'NonKeyAttributes ' => ! isset ($ item ['Projection ' ]['NonKeyAttributes ' ]) ? null : $ this ->populateResultNonKeyAttributeNameList ($ item ['Projection ' ]['NonKeyAttributes ' ]),
172
172
]),
173
173
'IndexSizeBytes ' => isset ($ item ['IndexSizeBytes ' ]) ? (string ) $ item ['IndexSizeBytes ' ] : null ,
174
174
'ItemCount ' => isset ($ item ['ItemCount ' ]) ? (string ) $ item ['ItemCount ' ] : null ,
@@ -211,7 +211,7 @@ private function populateResultReplicaDescriptionList(array $json): array
211
211
'ProvisionedThroughputOverride ' => empty ($ item ['ProvisionedThroughputOverride ' ]) ? null : new ProvisionedThroughputOverride ([
212
212
'ReadCapacityUnits ' => isset ($ item ['ProvisionedThroughputOverride ' ]['ReadCapacityUnits ' ]) ? (string ) $ item ['ProvisionedThroughputOverride ' ]['ReadCapacityUnits ' ] : null ,
213
213
]),
214
- 'GlobalSecondaryIndexes ' => empty ($ item ['GlobalSecondaryIndexes ' ]) ? [] : $ this ->populateResultReplicaGlobalSecondaryIndexDescriptionList ($ item ['GlobalSecondaryIndexes ' ]),
214
+ 'GlobalSecondaryIndexes ' => ! isset ($ item ['GlobalSecondaryIndexes ' ]) ? null : $ this ->populateResultReplicaGlobalSecondaryIndexDescriptionList ($ item ['GlobalSecondaryIndexes ' ]),
215
215
'ReplicaInaccessibleDateTime ' => (isset ($ item ['ReplicaInaccessibleDateTime ' ]) && ($ d = \DateTimeImmutable::createFromFormat ('U.u ' , sprintf ('%.6F ' , $ item ['ReplicaInaccessibleDateTime ' ])))) ? $ d : null ,
216
216
]);
217
217
}
0 commit comments