Description
As the release of PHP 8.1 is just over a month away, I started testing my code on PHP 8.1-RC4.
In PHP 8.1, return types were added on a lot of functions, one of them being \Countable::count(...)
. Since the current version of this library does not have a return type on \Clue\React\Mq\Queue::count(...)
- and I'm guessing won't any time soon for backwards compatibility - PHP throws a deprecation warning. When PHPUnit or an other testing library is configured to treat deprecations as exceptions, tests fail. From PHP 9 on, this will result in a fatal error.
Currently, the RFC suggests using the attribute #[ReturnTypeWillChange]
which is backwards compatible with the versions currently supported by this library. I guess an alternative would be to declare an alternative function signature for newer versions of PHP.
What do you think?
👋