Closed
Description
Symfony version(s) affected
6.0
Description
Having a #[AsMessageHandler]
on a method (except __invoke
) taking a union will prevent compilation.
How to reproduce
#[AsMessageHandler]
public function method(A|B $message): void {}
Possible Solution
In the MessengerPass::guessHandledClasses()
method, every path except the one dealing with union types return if method is known array<class-string, method>
else array<int, class-string>
. Code path dealing with unions does not.