use explicitly nullable parameter types (implicit deprecated in php 8.4)#1369
use explicitly nullable parameter types (implicit deprecated in php 8.4)#1369slepic wants to merge 1 commit intophp-enqueue:masterfrom
Conversation
|
I think we cannot do that. Changing argument types by widening them for classes that can potentially be extended - as we do not prohibit it - would be a breaking change (syntax error) if any of those methods is redeclared. This deprecation can only be removed in major version, and as you've noted majority of those do not actually allow |
it's actually not widening the types, it just uses more uptodate syntax for the same if you extend a class which has see here
actually right now, they do setThis(null);rather than setThis();right now both are allowed, which may be artifact of the fact that since 7.1 the new syntax allows to distinguish between the two but whether to remove the default while the contents of this PR are totally ok for a patch version |
https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
enqueue packages declares to require at least php ^7.4, therefore the ?T syntax is used here.
I believe that many of those parameters dont actually need a default value, but I leave that out because it might be BC if someone is actually calling those setters with no params.