$options +=
array_filter($tag);
unset($options['handles'
]);
$priority =
$options['priority'
] ?? 0;
$method =
$options['method'
] ?? '__invoke';
if (isset($options['bus'
])) { if (!\
in_array($options['bus'
],
$busIds)) { // @deprecated since Symfony 6.2, in 7.0 change to:
// $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 configuration '.
$messageLocation.' for message "%s": bus "%s" does not exist.',
$message,
$options['bus'
]));
} $buses =
[$options['bus'
]];
} if ('*' !==
$message && !
class_exists($message) && !
interface_exists($message, false
)) { // @deprecated since Symfony 6.2, in 7.0 change to:
// $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));