First of all, this library is super cool .
Lately, I have encountered a small problem that prevented me from using it.
In case there are transports (single or multiple) but also classes implementing ReceiverInterface without being attached to a transport, the registration of "the transport" is prevented because it implements receiverInterface but not transportInterface.
I tried with this test case and i received this type of error
self::bootKernel(['environment' => 'with_receiver']);
$this->expectException(\TypeError::class);
$this->expectExceptionMessage('Zenstruck\Messenger\Test\Transport\TestTransportRegistry::register(): Argument #2 ($transport) must be of type Symfony\Component\Messenger\Transport\TransportInterface');
$this->messenger();
In the compiler pass, the check is based on
$container->findTaggedServiceIds('messenger.receiver')
but it does not distinguish if it's a class that just implements ReceiverInterface or TransportInterface
and then, the method call "register" of TestTransportRegistry expects a TransportInterface.
If it's possible, I would like to suggest a fix. #52
Hello,
First of all, this library is super cool . Lately, I have encountered a small problem that prevented me from using it. In case there are transports (single or multiple) but also classes implementing ReceiverInterface without being attached to a transport, the registration of "the transport" is prevented because it implements receiverInterface but not transportInterface.
For example:
if I have in config:
I tried with this test case and i received this type of error
In the compiler pass, the check is based on
$container->findTaggedServiceIds('messenger.receiver')
but it does not distinguish if it's a class that just implements ReceiverInterface or TransportInterface and then, the method call "register" of TestTransportRegistry expects a TransportInterface.If it's possible, I would like to suggest a fix. #52
Thanks again for this library!