RabbitMqBundle icon indicating copy to clipboard operation
RabbitMqBundle copied to clipboard

ConsumerInterface service is not valid value for RPC server callback

Open shadz3rg opened this issue 3 years ago • 0 comments

-> package documentation declare term callback -> callback is valid Symfony service -> callback should implement \OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface technically, there is no instance validation, any object with execute method will be valid, but this is not documented (https://github.com/php-amqplib/RabbitMqBundle/blob/a86783b2cf8653872eb895d12dda29f9c3f2f139/DependencyInjection/OldSoundRabbitMqExtension.php) -> callback::execute should return int|false, and this signature is not compatible with RPC server callback (which should return response data)

While signature is not breaking functionality for now, IDE and static analyzers having troubles with that. IMO there should be introduced separate ServerInterface and documented as possible callback for RPC section.

shadz3rg avatar Sep 07 '22 12:09 shadz3rg