File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -131,26 +131,25 @@ marker, like this::
131
131
132
132
class MyOwnMiddleware implements MiddlewareInterface, EnvelopeAwareInterface
133
133
{
134
- public function handle($message , callable $next)
134
+ public function handle($envelope , callable $next)
135
135
{
136
- // $message here is an `Envelope` object, because this middleware
136
+ // $envelope here is an `Envelope` object, because this middleware
137
137
// implements the EnvelopeAwareInterface interface.
138
138
139
- if (null !== $message ->get(ReceivedMessage::class)) {
139
+ if (null !== $envelope ->get(ReceivedMessage::class)) {
140
140
// Message just has been received...
141
141
142
142
// You could for example add another item.
143
- $message = $message ->with(new AnotherEnvelopeItem(/* ... */));
143
+ $envelope = $envelope ->with(new AnotherEnvelopeItem(/* ... */));
144
144
}
145
145
146
- return $next($message );
146
+ return $next($envelope );
147
147
}
148
148
}
149
149
150
150
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 `.
154
153
155
154
Transports
156
155
----------
You can’t perform that action at this time.
0 commit comments