Skip to content

Commit 8cbecd5

Browse files
author
palPalani
committed
Use key to avoid one more deep level
1 parent bebac86 commit 8cbecd5

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Sqs/Queue.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,11 @@ private function modifyMultiplePayload($payload, $class)
141141

142142
$body = [];
143143
$attributes = [];
144-
$batchIds = [];
145144

146-
foreach ($payload as $item) {
145+
foreach ($payload as $k => $item) {
147146
//Log::debug('Each Messages==', [$item]);
148147
//$body[] = json_decode($item['Body'], true);
149-
$body[] = [
148+
$body[$k] = [
150149
'messages' => json_decode($item['Body'], true),
151150
'attributes' => $item['Attributes'],
152151
'batchIds' => [
@@ -171,8 +170,6 @@ private function modifyMultiplePayload($payload, $class)
171170
'Body' => json_encode($body),
172171
'Attributes' => $attributes,
173172
];
174-
175-
//return $newPayload;
176173
}
177174

178175
/**

0 commit comments

Comments
 (0)