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

Improve PHP 8.3 Support #545

Merged
merged 2 commits into from
Nov 27, 2023
Merged

Improve PHP 8.3 Support #545

merged 2 commits into from
Nov 27, 2023

Conversation

swissspidy
Copy link
Contributor

Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like upstream PhpStan updates have identified more issues that should be addressed which are not related to the changes here. @thelovekesh is this something you can investigate?

php: ['8.1','8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6']
php: ['8.2', '8.1', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is dropping 8.0 since it is redundant with the include below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly!

@westonruter westonruter modified the milestones: 0.11.4, 0.11.5 Nov 27, 2023
@@ -330,6 +330,7 @@ private function reset()
* parameters if an int or string is passed. Defaults to an empty array.
* @return bool true on success or false on failure.
*/
#[\ReturnTypeWillChange]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So without this, PHP 8.3 was issuing a warning? Is this needed because DOMDocument::loadHTML() is now defined as strictly returning bool with type declaration, whereas here we omit the type for back-compat with older PHP? If so, we could alternatively just add the type declarations since we're now only using PHP 7.4 in the AMP plugin and Web Stores plugin. But then we'd need to update:

"php": "^5.6 || ^7.0 || ^8.0",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it‘s because of the changed return type in 8.3.
Types could be added indeed, though perhaps best to do that separately.

@westonruter westonruter merged commit 391740f into ampproject:main Nov 27, 2023
15 of 16 checks passed
@swissspidy swissspidy deleted the add/php83 branch November 27, 2023 22:19
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

Successfully merging this pull request may close these issues.

2 participants