Skip to content
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

PHP 8.4 Compatibility #549

Open
swissspidy opened this issue Apr 3, 2024 · 1 comment
Open

PHP 8.4 Compatibility #549

swissspidy opened this issue Apr 3, 2024 · 1 comment
Assignees
Milestone

Comments

@swissspidy
Copy link
Contributor

I wanted to test PHP 8.4 compatibility in the Web Stories plugin a bit early and noticed a few deprecation warnings coming from the AMP PHP Toolbox:

PHP Deprecated:  Implicitly marking parameter $node as nullable is deprecated, the explicit nullable type must be used instead in /home/runner/work/web-stories-wp/web-stories-wp/third-party/vendor/ampproject/amp-toolbox/src/Dom/Document.php on line 343
PHP Deprecated:  Implicitly marking parameter $node as nullable is deprecated, the explicit nullable type must be used instead in /home/runner/work/web-stories-wp/web-stories-wp/third-party/vendor/ampproject/amp-toolbox/src/Dom/Document.php on line 353
PHP Deprecated:  Implicitly marking parameter $node as nullable is deprecated, the explicit nullable type must be used instead in /home/runner/work/web-stories-wp/web-stories-wp/vendor/ampproject/amp-toolbox/src/Dom/Document.php on line 416
PHP Deprecated:  Implicitly marking parameter $node as nullable is deprecated, the explicit nullable type must be used instead in /home/runner/work/web-stories-wp/web-stories-wp/vendor/ampproject/amp-toolbox/src/Dom/Document.php on line 427
PHP Deprecated:  Implicitly marking parameter $configuration as nullable is deprecated, the explicit nullable type must be used instead in /home/runner/work/web-stories-wp/web-stories-wp/third-party/vendor/ampproject/amp-toolbox/src/Optimizer/TransformationEngine.php on line 51

This is related to the PHP RFC to deprecate implicitly nullable parameter types. See https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated for a good explanation & ways to address this.

The problem is that nullable types were only added in PHP 7.1 but this library still supports PHP 5.6.

I suggest to just bump the minimum PHP requirement to PHP 7.4 (like the AMP plugin and the Web Stories plugin) in a 0.12 release and highlight this as a breaking change.

@westonruter
Copy link
Member

@thelovekesh Could you make this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants