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
Throw an exception when the method do not exist
Add an example of the specific method in the interface docblock
Add the method in the hash and prefix it
$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());
104
+
if (\is_array($method)) {
105
+
$messagePriority = $method[1];
106
+
$method = $method[0];
107
+
}
108
+
109
+
if (!\class_exists($messageClass)) {
110
+
$messageClassLocation = isset($tag['handles']) ? 'declared in your tag attribute "handles&qu
6D40
ot;' : $r->implementsInterface(MessageHandlerInterface::class) ? sprintf('returned by method "%s::getHandledMessages()"', $r->getName()) : sprintf('used as argument type in method "%s::%s()"', $r->getName(), $method);
92
111
93
112
thrownewRuntimeException(sprintf('Invalid handler service "%s": message class "%s" %s does not exist.', $serviceId, $messageClass, $messageClassLocation));
94
113
}
95
114
115
+
if (!$r->hasMethod($method)) {
116
+
thrownewRuntimeException(sprintf('Invalid handler service "%s": method "%s::%s()" does not exist.', $serviceId, $r->getName(), $method));
* @expectedExceptionMessage Invalid handler service "Symfony\Component\Messenger\Tests\DependencyInjection\HandlerMappingWithNonExistentMethod": method "Symfony\Component\Messenger\Tests\DependencyInjection\HandlerMappingWithNonExistentMethod::dummyMethod()" does not exist.
0 commit comments