-
Notifications
You must be signed in to change notification settings - Fork 144
[BUGFIX] Ensure PHP 8.4 compatibility for nullable parameters #677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is the backport of #643. |
Another note: This blocks PHP 8.4 support for Emogrifier: MyIntervals/emogrifier#1278 |
c6c9f34
to
e421dd4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right. It seems to be reverting a previous change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
null
default value also havenull
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