Closed matthi4s closed 2 years ago
Dear contributor,
because this pull request seems to be inactive for quite some time now, I've automatically closed it. If you feel this pull request deserves some attention from my human colleagues feel free to reopen it.
@freekmurze could you review this merge request?
Thanks!
Thanks! Errors in php 8.1 are gone :)
In PHP 8.1 the functions required by the
ArrayAccess
interface require a return type or they will log a deprecation warning:(see https://php.watch/versions/8.1/internal-method-return-types)
I've added a return type to the
ArrayAccess
functionsoffsetExists()
,offsetSet()
,offsetGet()
andoffsetUnset()
in thePool
class. Even though most of them aren't actually implemented, they still need a return type to avoid the deprecation warning. TheoffsetGet()
function returns theRunnable
type instead of the defaultmixed
because that wouldn't be compatible with PHP 7.4.Another solution would be to add the
#[ReturnTypeWillChange]
attribute, but that will probably break in PHP 9.0. The current solution is backwards compatible with PHP 7.4 and PHP 8.0, but will break for anyone that has extended thePool
class and overwrites theArrayAccess
functions without giving a proper return type. I think it's highly unlikely that anybody does that, but if you prefer, I can also just add the#[ReturnTypeWillChange]
attribute.