Skip to content

Commit 7a2c7a9

Browse files
committed
minor #19742 [Messenger] docs(messenger): encodedEnvelope is already an array (pierreboissinot)
This PR was merged into the 5.4 branch. Discussion ---------- [Messenger] docs(messenger): encodedEnvelope is already an array See 3c4fe2a#r132772105 Commits ------- 4b42411 docs: encodedEnvelope is already an array
2 parents ef7b670 + 4b42411 commit 7a2c7a9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

messenger.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,12 +2603,10 @@ Let's say you want to create a message decoder::
26032603
{
26042604
public function decode(array $encodedEnvelope): Envelope
26052605
{
2606-
$envelope = \json_decode($encodedEnvelope, true);
2607-
26082606
try {
26092607
// parse the data you received with your custom fields
2610-
$data = $envelope['data'];
2611-
$data['token'] = $envelope['token'];
2608+
$data = $encodedEnvelope['data'];
2609+
$data['token'] = $encodedEnvelope['token'];
26122610

26132611
// other operations like getting information from stamps
26142612
} catch (\Throwable $throwable) {

0 commit comments

Comments
 (0)