Skip to content

Commit a87d727

Browse files
authored
Renaming variable
1 parent 16c7385 commit a87d727

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

components/messenger.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,26 +131,25 @@ marker, like this::
131131

132132
class MyOwnMiddleware implements MiddlewareInterface, EnvelopeAwareInterface
133133
{
134-
public function handle($message, callable $next)
134+
public function handle($envelope, callable $next)
135135
{
136-
// $message here is an `Envelope` object, because this middleware
136+
// $envelope here is an `Envelope` object, because this middleware
137137
// implements the EnvelopeAwareInterface interface.
138138

139-
if (null !== $message->get(ReceivedMessage::class)) {
139+
if (null !== $envelope->get(ReceivedMessage::class)) {
140140
// Message just has been received...
141141

142142
// You could for example add another item.
143-
$message = $message->with(new AnotherEnvelopeItem(/* ... */));
143+
$envelope = $envelope->with(new AnotherEnvelopeItem(/* ... */));
144144
}
145145

146-
return $next($message);
146+
return $next($envelope);
147147
}
148148
}
149149

150150
The above example will forward the message to the next middleware with an additional
151-
envelope item if the message has just been received (i.e. has the `ReceivedMessage` item).
152-
You can create your own items by implementing the :class:`Symfony\\Component\\Messenger\\EnvelopeAwareInterface`
153-
interface.
151+
envelope item *if* the message has just been received (i.e. has the `ReceivedMessage` item).
152+
You can create your own items by implementing :class:`Symfony\\Component\\Messenger\\EnvelopeAwareInterface`.
154153

155154
Transports
156155
----------

0 commit comments

Comments
 (0)