kwn / php-rdkafka-stubs

Rdkafka extension stubs for your IDE. Always compatibile with the latest php-rdkafka version.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ProducerTopic::produce and ::producev throw Exception too

damianwadley opened this issue · comments

https://arnaud.le-blanc.net/php-rdkafka-doc/phpdoc/rdkafka-producertopic.produce.html
https://arnaud.le-blanc.net/php-rdkafka-doc/phpdoc/rdkafka-producertopic.producev.html

As prevalent as Exception is, there may be other methods that also throw Exception and aren't listed as such in the stubs, but those two are the ones I'm currently aware of.

Hi @damianwadley

Thank you for reporting an issue. Is there any chance you could open a PR and update relevant signatures please?

Sorry about the delay. I'll get a PR up for you today.

@kwn As I go through these files looking for methods missing a @throws Exception, I can see some other things worth fixing. Like sometimes an array of objects is typed as array and sometimes as Class[]. There are also some methods missing, like KafkaConsumerTopic has a few more than just offsetStore (the only one listed in the online documentation) and consumeCallback (present in the stub). And I often see that the docs are out of date or incomplete, compared to the source code, which means the stubs may be affected too.

Would you like me to include fixes for those problems in this PR too? (Obviously we can talk about them inside the PR too.) Or should I just fix the missing Exceptions?

We can leave this issue as just about the @throws. I can file another issue to sync the stubs with the source code, if you'd like.

@kwn Anything you need from me?

Hi @damianwadley

Apologies, didn't have time to review it. I just merged your PR and will tag a new version soon. Thank you for your contribution!