Skip to content

Commit 75373f1

Browse files
committed
Remove ReturnTypeWillChange attribute
Restore check
1 parent 4326ba7 commit 75373f1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/Job/Message.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
use Interop\Queue\Context;
2323
use Interop\Queue\Message as QueueMessage;
2424
use JsonSerializable;
25-
use ReturnTypeWillChange;
2625
use RuntimeException;
2726

2827
class Message implements JsonSerializable
@@ -122,7 +121,12 @@ public function getTarget(): array
122121
public function getArgument(mixed $key = null, mixed $default = null): mixed
123122
{
124123
// support old jobs that still use args key
125-
$data = $this->parsedBody['data'] ?? $this->parsedBody['args'][0];
124+
if (array_key_exists('data', $this->parsedBody)) {
125+
$data = $this->parsedBody['data'];
126+
} else {
127+
// support old jobs that still use args key
128+
$data = $this->parsedBody['args'][0];
129+
}
126130

127131
if ($key === null) {
128132
return $data;
@@ -156,7 +160,6 @@ public function __toString(): string
156160
*
157161
* @return array<string, mixed>
158162
*/
159-
#[ReturnTypeWillChange]
160163
public function jsonSerialize(): array
161164
{
162165
return $this->parsedBody;

0 commit comments

Comments
 (0)