[BUGFIX] Ensure PHP 8.4 compatibility for nullable parameters#677
[BUGFIX] Ensure PHP 8.4 compatibility for nullable parameters#677oliverklee wants to merge 1 commit into
Conversation
|
This is the backport of #643. |
|
Another note: This blocks PHP 8.4 support for Emogrifier: MyIntervals/emogrifier#1278 |
c6c9f34 to
e421dd4
Compare
JakeQZ
left a comment
There was a problem hiding this comment.
I think something has gone awry in the merge.
The original change affected only 4 files. This affects 22. It looks like you have omitted a git pull.
| * @param OutputFormat $oOutputFormat | ||
| * | ||
| * @return string | ||
| */ | ||
| public function render(OutputFormat $oOutputFormat) | ||
| public function render($oOutputFormat) |
There was a problem hiding this comment.
This doesn't look right. It seems to be reverting a previous change.
There was a problem hiding this comment.
Yes, it's removing the type declaration.
The reason for this that there are two possible ways to fix the implicit nullable parameters:
- make the parameters explicitly nullable using a native type declaration (which is not possible with PHP 5.6, which we support in this branch)
- drop the native type declaration for this parameter and use PHPDoc type annotations instead
I'll create a separate pre-PR to do 2. first (without changing the type).
There was a problem hiding this comment.
There is another way, which is to make a 9.0 release with where we're at. The only breaking change I'm aware of is requiring PHP >= 7.2.
e421dd4 to
39a7c72
Compare
Ensure that parameters that have a `null` default value also have `null` as part of their type annotations. Also remove native type declarations for nullable parameters (as nullable parameters are not possible with some of the PHP versions we currently support). https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated Fixes #634
39a7c72 to
f65d376
Compare
|
According to #701, this change does not seem to be necessary after all. Closing. |
Ensure that parameters that have a
nulldefault value also havenullas part of their type annotations.Also remove native type declarations for nullable parameters (as nullable parameters are not possible with some of the PHP versions we currently support).
https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated
Fixes #634