amphp/beanstalk

Wrong return types

mmenozzi opened this issue · 4 comments

Hi,
I think that the send callbacks of the following BeanstalkClient methods have the wrong return type:

  • \Amp\Beanstalk\BeanstalkClient::delete: return type hint is int but it returns bool (anyway this doesn't raise an error)
  • \Amp\Beanstalk\BeanstalkClient::bury: return type hint is int but it returns bool (anyway this doesn't raise an error)
  • \Amp\Beanstalk\BeanstalkClient::touch: return type hint is int but it returns bool (anyway this doesn't raise an error)
  • \Amp\Beanstalk\BeanstalkClient::release: return type hint is int but it returns string (this raises a fatal error)

What do you think?

release() definitely needs to be fixed, the others are a slight (theoretical) BC break. I'd probably leave them as is until there's a new major version. Want to provide a PR?

I already had the project open now, because I wanted to see if the IDE really doesn't catch those. Just fixed it and will release a new version in a few minutes.

Thank you!!