// $messageLocation = isset($tag['handles']) ? 'declared in your tag attribute "handles"' : sprintf('used as argument type in method "%s::%s()"', $r->getName(), $method);
$messageLocation =
isset($tag['handles'
]) ? 'declared in your tag attribute "handles"' :
($r->
implementsInterface(MessageSubscriberInterface::
class) ?
sprintf('returned by method "%s::getHandledMessages()"',
$r->
getName()) :
sprintf('used as argument type in method "%s::%s()"',
$r->
getName(),
$method));
throw new RuntimeException(sprintf('Invalid handler service "%s": class or interface "%s" '.
$messageLocation.' not found.',
$serviceId,
$message));
} if (!
$r->
hasMethod($method)) { throw new RuntimeException(sprintf('Invalid handler service "%s": method "%s::%s()" does not exist.',
$serviceId,
$r->
getName(),
$method));
} if ('__invoke' !==
$method) { $wrapperDefinition =
(new Definition('Closure'
))->
addArgument([new Reference($serviceId),
$method])->
setFactory('Closure::fromCallable'
);
$definitions[$definitionId = '.messenger.method_on_object_wrapper.'.ContainerBuilder::
hash($message.':'.
$priority.':'.
$serviceId.':'.
$method)] =
$wrapperDefinition;
} else { $definitionId =
$serviceId;
} $handlerToOriginalServiceIdMapping[$definitionId] =
$serviceId;
foreach ($buses as $handlerBus) { $handlersByBusAndMessage[$handlerBus][$message][$priority][] =
[$definitionId,
$options];
} }