@@ -42,9 +42,9 @@ protected function populateResult(Response $response): void
4242 $ data = $ response ->toArray ();
4343
4444 $ 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 ' ]),
4646 '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 ' ]),
4848 'TableStatus ' => isset ($ data ['TableDescription ' ]['TableStatus ' ]) ? (string ) $ data ['TableDescription ' ]['TableStatus ' ] : null ,
4949 'CreationDateTime ' => (isset ($ data ['TableDescription ' ]['CreationDateTime ' ]) && ($ d = \DateTimeImmutable::createFromFormat ('U.u ' , sprintf ('%.6F ' , $ data ['TableDescription ' ]['CreationDateTime ' ])))) ? $ d : null ,
5050 'ProvisionedThroughput ' => empty ($ data ['TableDescription ' ]['ProvisionedThroughput ' ]) ? null : new ProvisionedThroughputDescription ([
@@ -62,16 +62,16 @@ protected function populateResult(Response $response): void
6262 'BillingMode ' => isset ($ data ['TableDescription ' ]['BillingModeSummary ' ]['BillingMode ' ]) ? (string ) $ data ['TableDescription ' ]['BillingModeSummary ' ]['BillingMode ' ] : null ,
6363 'LastUpdateToPayPerRequestDateTime ' => (isset ($ data ['TableDescription ' ]['BillingModeSummary ' ]['LastUpdateToPayPerRequestDateTime ' ]) && ($ d = \DateTimeImmutable::createFromFormat ('U.u ' , sprintf ('%.6F ' , $ data ['TableDescription ' ]['BillingModeSummary ' ]['LastUpdateToPayPerRequestDateTime ' ])))) ? $ d : null ,
6464 ]),
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 ' ]),
6767 'StreamSpecification ' => empty ($ data ['TableDescription ' ]['StreamSpecification ' ]) ? null : new StreamSpecification ([
6868 'StreamEnabled ' => filter_var ($ data ['TableDescription ' ]['StreamSpecification ' ]['StreamEnabled ' ], \FILTER_VALIDATE_BOOLEAN ),
6969 'StreamViewType ' => isset ($ data ['TableDescription ' ]['StreamSpecification ' ]['StreamViewType ' ]) ? (string ) $ data ['TableDescription ' ]['StreamSpecification ' ]['StreamViewType ' ] : null ,
7070 ]),
7171 'LatestStreamLabel ' => isset ($ data ['TableDescription ' ]['LatestStreamLabel ' ]) ? (string ) $ data ['TableDescription ' ]['LatestStreamLabel ' ] : null ,
7272 'LatestStreamArn ' => isset ($ data ['TableDescription ' ]['LatestStreamArn ' ]) ? (string ) $ data ['TableDescription ' ]['LatestStreamArn ' ] : null ,
7373 '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 ' ]),
7575 'RestoreSummary ' => empty ($ data ['TableDescription ' ]['RestoreSummary ' ]) ? null : new RestoreSummary ([
7676 'SourceBackupArn ' => isset ($ data ['TableDescription ' ]['RestoreSummary ' ]['SourceBackupArn ' ]) ? (string ) $ data ['TableDescription ' ]['RestoreSummary ' ]['SourceBackupArn ' ] : null ,
7777 'SourceTableArn ' => isset ($ data ['TableDescription ' ]['RestoreSummary ' ]['SourceTableArn ' ]) ? (string ) $ data ['TableDescription ' ]['RestoreSummary ' ]['SourceTableArn ' ] : null ,
@@ -117,10 +117,10 @@ private function populateResultGlobalSecondaryIndexDescriptionList(array $json):
117117 foreach ($ json as $ item ) {
118118 $ items [] = new GlobalSecondaryIndexDescription ([
119119 '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 ' ]),
121121 'Projection ' => empty ($ item ['Projection ' ]) ? null : new Projection ([
122122 '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 ' ]),
124124 ]),
125125 'IndexStatus ' => isset ($ item ['IndexStatus ' ]) ? (string ) $ item ['IndexStatus ' ] : null ,
126126 'Backfilling ' => isset ($ item ['Backfilling ' ]) ? filter_var ($ item ['Backfilling ' ], \FILTER_VALIDATE_BOOLEAN ) : null ,
@@ -165,10 +165,10 @@ private function populateResultLocalSecondaryIndexDescriptionList(array $json):
165165 foreach ($ json as $ item ) {
166166 $ items [] = new LocalSecondaryIndexDescription ([
167167 '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 ' ]),
169169 'Projection ' => empty ($ item ['Projection ' ]) ? null : new Projection ([
170170 '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 ' ]),
172172 ]),
173173 'IndexSizeBytes ' => isset ($ item ['IndexSizeBytes ' ]) ? (string ) $ item ['IndexSizeBytes ' ] : null ,
174174 'ItemCount ' => isset ($ item ['ItemCount ' ]) ? (string ) $ item ['ItemCount ' ] : null ,
@@ -211,7 +211,7 @@ private function populateResultReplicaDescriptionList(array $json): array
211211 'ProvisionedThroughputOverride ' => empty ($ item ['ProvisionedThroughputOverride ' ]) ? null : new ProvisionedThroughputOverride ([
212212 'ReadCapacityUnits ' => isset ($ item ['ProvisionedThroughputOverride ' ]['ReadCapacityUnits ' ]) ? (string ) $ item ['ProvisionedThroughputOverride ' ]['ReadCapacityUnits ' ] : null ,
213213 ]),
214- 'GlobalSecondaryIndexes ' => empty ($ item ['GlobalSecondaryIndexes ' ]) ? [] : $ this ->populateResultReplicaGlobalSecondaryIndexDescriptionList ($ item ['GlobalSecondaryIndexes ' ]),
214+ 'GlobalSecondaryIndexes ' => ! isset ($ item ['GlobalSecondaryIndexes ' ]) ? null : $ this ->populateResultReplicaGlobalSecondaryIndexDescriptionList ($ item ['GlobalSecondaryIndexes ' ]),
215215 'ReplicaInaccessibleDateTime ' => (isset ($ item ['ReplicaInaccessibleDateTime ' ]) && ($ d = \DateTimeImmutable::createFromFormat ('U.u ' , sprintf ('%.6F ' , $ item ['ReplicaInaccessibleDateTime ' ])))) ? $ d : null ,
216216 ]);
217217 }
0 commit comments