You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$messageClassLocation = isset($tag['handles']) ? 'declared in your tag attribute "handles"' : sprintf('used as argument type in method "%s::__invoke()"', $r->getName());
74
-
75
-
thrownewRuntimeException(sprintf('Invalid handler service "%s": message class "%s" %s does not exist.', $serviceId, $handles, $messageClassLocation));
$messageClassLocation = isset($tag['handles']) ? 'declared in your tag attribute "handles"' : sprintf($r->implementsInterface(MessageHandlerInterface::class) ? 'returned by method "%s::getHandledMessages()"' : 'used as argument type in method "%s::__invoke()"', $r->getName());
88
+
89
+
thrownewRuntimeException(sprintf('Invalid handler service "%s": message class "%s" %s does not exist.', $serviceId, $messageClass, $messageClassLocation));
@@ -129,7 +147,7 @@ private function guessHandledClass(\ReflectionClass $handlerClass, string $servi
129
147
thrownewRuntimeException(sprintf('Invalid handler service "%s": type-hint of argument "$%s" in method "%s::__invoke()" must be a class , "%s" given.', $serviceId, $parameters[0]->getName(), $handlerClass->getName(), $type));
* @expectedExceptionMessage Invalid handler service "Symfony\Component\Messenger\Tests\DependencyInjection\UndefinedMessageHandler": message class "Symfony\Component\Messenger\Tests\DependencyInjection\UndefinedMessage" used as argument type in method "Symfony\Component\Messenger\Tests\DependencyInjection\UndefinedMessageHandler::__invoke()" does not exist.
@@ -65,6 +96,21 @@ public function testUndefinedMessageClassForHandler()
* @expectedExceptionMessage Invalid handler service "Symfony\Component\Messenger\Tests\DependencyInjection\UndefinedMessageHandlerViaInterface": message class "Symfony\Component\Messenger\Tests\DependencyInjection\UndefinedMessage" returned by method "Symfony\Component\Messenger\Tests\DependencyInjection\UndefinedMessageHandlerViaInterface::getHandledMessages()" does not exist.
* @expectedExceptionMessage Invalid handler service "Symfony\Component\Messenger\Tests\DependencyInjection\NotInvokableHandler": class "Symfony\Component\Messenger\Tests\DependencyInjection\NotInvokableHandler" must have an "__invoke()" method.
@@ -168,6 +214,18 @@ public function __invoke(UndefinedMessage $message)
168
214
}
169
215
}
170
216
217
+
class UndefinedMessageHandlerViaInterface implements MessageHandlerInterface
218
+
{
219
+
publicstaticfunctiongetHandledMessages(): array
220
+
{
221
+
returnarray(UndefinedMessage::class);
222
+
}
223
+
224
+
publicfunction__invoke()
225
+
{
226
+
}
227
+
}
228
+
171
229
class NotInvokableHandler
172
230
{
173
231
}
@@ -192,3 +250,24 @@ public function __invoke(string $message)
192
250
{
193
251
}
194
252
}
253
+
254
+
class HandlerWithMultipleMessages implements MessageHandlerInterface
255
+
{
256
+
publicstaticfunctiongetHandledMessages(): array
257
+
{
258
+
returnarray(
259
+
DummyMessage::class,
260
+
SecondMessage::class,
261
+
);
262
+
}
263
+
}
264
+
265
+
class PrioritisedHandler implements MessageHandlerInterface
0 commit comments