php-enqueue / enqueue-dev

Message Queue, Job Queue, Broadcasting, WebSockets packages for PHP, Symfony, Laravel, Magento. DEVELOPMENT REPOSITORY - provided by Forma-Pro
https://enqueue.forma-pro.com/
MIT License
2.17k stars 429 forks source link

[ENQUEUE] Precise phpdoc for static analysis #1306

Closed VincentLanglet closed 10 months ago

VincentLanglet commented 1 year ago

HI @makasim,

The CommandSubscriberInterface::getSubscribedCommand is currently annotated with string|array return type. Static analysis tool allows to provide a more precise return type. This PR allow PHPStan and Psalm users to have to proper static analysis of the return type when implementing the interface.

I based the array type on the current phpdoc, talking about

     * [
     *   'command' => 'aSubscribedCommand',
     *   'processor' => 'aProcessorName',
     *   'queue' => 'a_client_queue_name',
     *   'prefix_queue' => true,
     *   'exclusive' => true,
     * ]
VincentLanglet commented 10 months ago

Friendly ping @makasim