@@ -126,17 +126,17 @@ protected function populateResult(ResponseInterface $response, HttpClientInterfa
126
126
$ data = new \SimpleXMLElement ($ response ->getContent (false ));
127
127
$ data = $ data ->DescribeStacksResult ;
128
128
129
- $ this ->Stacks = (function (\SimpleXMLElement $ xml ): array {
129
+ $ this ->Stacks = ! $ data -> Stacks ? [] : (function (\SimpleXMLElement $ xml ): array {
130
130
$ items = [];
131
- foreach ($ xml as $ item ) {
131
+ foreach ($ xml-> member as $ item ) {
132
132
$ items [] = new Stack ([
133
133
'StackId ' => ($ v = $ item ->StackId ) ? (string ) $ v : null ,
134
134
'StackName ' => (string ) $ item ->StackName ,
135
135
'ChangeSetId ' => ($ v = $ item ->ChangeSetId ) ? (string ) $ v : null ,
136
136
'Description ' => ($ v = $ item ->Description ) ? (string ) $ v : null ,
137
- 'Parameters ' => (function (\SimpleXMLElement $ xml ): array {
137
+ 'Parameters ' => ! $ item -> Parameters ? [] : (function (\SimpleXMLElement $ xml ): array {
138
138
$ items = [];
139
- foreach ($ xml as $ item ) {
139
+ foreach ($ xml-> member as $ item ) {
140
140
$ items [] = new Parameter ([
141
141
'ParameterKey ' => ($ v = $ item ->ParameterKey ) ? (string ) $ v : null ,
142
142
'ParameterValue ' => ($ v = $ item ->ParameterValue ) ? (string ) $ v : null ,
@@ -150,10 +150,10 @@ protected function populateResult(ResponseInterface $response, HttpClientInterfa
150
150
'CreationTime ' => new \DateTimeImmutable ((string ) $ item ->CreationTime ),
151
151
'DeletionTime ' => ($ v = $ item ->DeletionTime ) ? new \DateTimeImmutable ((string ) $ v ) : null ,
152
152
'LastUpdatedTime ' => ($ v = $ item ->LastUpdatedTime ) ? new \DateTimeImmutable ((string ) $ v ) : null ,
153
- 'RollbackConfiguration ' => new RollbackConfiguration ([
154
- 'RollbackTriggers ' => (function (\SimpleXMLElement $ xml ): array {
153
+ 'RollbackConfiguration ' => ! $ item -> RollbackConfiguration ? null : new RollbackConfiguration ([
154
+ 'RollbackTriggers ' => ! $ item -> RollbackConfiguration -> RollbackTriggers ? [] : (function (\SimpleXMLElement $ xml ): array {
155
155
$ items = [];
156
- foreach ($ xml as $ item ) {
156
+ foreach ($ xml-> member as $ item ) {
157
157
$ items [] = new RollbackTrigger ([
158
158
'Arn ' => (string ) $ item ->Arn ,
159
159
'Type ' => (string ) $ item ->Type ,
@@ -167,9 +167,9 @@ protected function populateResult(ResponseInterface $response, HttpClientInterfa
167
167
'StackStatus ' => (string ) $ item ->StackStatus ,
168
168
'StackStatusReason ' => ($ v = $ item ->StackStatusReason ) ? (string ) $ v : null ,
169
169
'DisableRollback ' => ($ v = $ item ->DisableRollback ) ? 'true ' === (string ) $ v : null ,
170
- 'NotificationARNs ' => (function (\SimpleXMLElement $ xml ): array {
170
+ 'NotificationARNs ' => ! $ item -> NotificationARNs ? [] : (function (\SimpleXMLElement $ xml ): array {
171
171
$ items = [];
172
- foreach ($ xml as $ item ) {
172
+ foreach ($ xml-> member as $ item ) {
173
173
$ a = ($ v = $ item ) ? (string ) $ v : null ;
174
174
if (null !== $ a ) {
175
175
$ items [] = $ a ;
@@ -179,9 +179,9 @@ protected function populateResult(ResponseInterface $response, HttpClientInterfa
179
179
return $ items ;
180
180
})($ item ->NotificationARNs ),
181
181
'TimeoutInMinutes ' => ($ v = $ item ->TimeoutInMinutes ) ? (int ) (string ) $ v : null ,
182
- 'Capabilities ' => (function (\SimpleXMLElement $ xml ): array {
182
+ 'Capabilities ' => ! $ item -> Capabilities ? [] : (function (\SimpleXMLElement $ xml ): array {
183
183
$ items = [];
184
- foreach ($ xml as $ item ) {
184
+ foreach ($ xml-> member as $ item ) {
185
185
$ a = ($ v = $ item ) ? (string ) $ v : null ;
186
186
if (null !== $ a ) {
187
187
$ items [] = $ a ;
@@ -190,9 +190,9 @@ protected function populateResult(ResponseInterface $response, HttpClientInterfa
190
190
191
191
return $ items ;
192
192
})($ item ->Capabilities ),
193
- 'Outputs ' => (function (\SimpleXMLElement $ xml ): array {
193
+ 'Outputs ' => ! $ item -> Outputs ? [] : (function (\SimpleXMLElement $ xml ): array {
194
194
$ items = [];
195
- foreach ($ xml as $ item ) {
195
+ foreach ($ xml-> member as $ item ) {
196
196
$ items [] = new Output ([
197
197
'OutputKey ' => ($ v = $ item ->OutputKey ) ? (string ) $ v : null ,
198
198
'OutputValue ' => ($ v = $ item ->OutputValue ) ? (string ) $ v : null ,
@@ -204,9 +204,9 @@ protected function populateResult(ResponseInterface $response, HttpClientInterfa
204
204
return $ items ;
205
205
})($ item ->Outputs ),
206
206
'RoleARN ' => ($ v = $ item ->RoleARN ) ? (string ) $ v : null ,
207
- 'Tags ' => (function (\SimpleXMLElement $ xml ): array {
207
+ 'Tags ' => ! $ item -> Tags ? [] : (function (\SimpleXMLElement $ xml ): array {
208
208
$ items = [];
209
- foreach ($ xml as $ item ) {
209
+ foreach ($ xml-> member as $ item ) {
210
210
$ items [] = new Tag ([
211
211
'Key ' => (string ) $ item ->Key ,
212
212
'Value ' => (string ) $ item ->Value ,
@@ -218,7 +218,7 @@ protected function populateResult(ResponseInterface $response, HttpClientInterfa
218
218
'EnableTerminationProtection ' => ($ v = $ item ->EnableTerminationProtection ) ? 'true ' === (string ) $ v : null ,
219
219
'ParentId ' => ($ v = $ item ->ParentId ) ? (string ) $ v : null ,
220
220
'RootId ' => ($ v = $ item ->RootId ) ? (string ) $ v : null ,
221
- 'DriftInformation ' => new StackDriftInformation ([
221
+ 'DriftInformation ' => ! $ item -> DriftInformation ? null : new StackDriftInformation ([
222
222
'StackDriftStatus ' => (string ) $ item ->DriftInformation ->StackDriftStatus ,
223
223
'LastCheckTimestamp ' => ($ v = $ item ->DriftInformation ->LastCheckTimestamp ) ? new \DateTimeImmutable ((string ) $ v ) : null ,
224
224
]),
0 commit comments