[1.8] Backport PHP 8.4 compat fixes#875
Merged
jtojnar merged 6 commits intosimplepie:one-dot-eightfrom Sep 25, 2024
Merged
Conversation
As per PHP docs, the XML functions also accept just a method name as a string,
even though it is not actually a callable:
Note: Instead of a function name, an array containing an object reference and a method name can also be supplied.
PHPStan level 5 will complain though:
Parameter simplepie#2 $handler of function xml_set_character_data_handler expects callable(): mixed, 'cdata' given.
Let’s use proper callables.
(cherry picked from commit f5c99dd)
This is deprecated in PHP 8.4.
(cherry picked from commit 6d40e1b) This is deprecated in PHP 8.4.
Contributor
Alkarex
approved these changes
Sep 14, 2024
Art4
approved these changes
Sep 15, 2024
Member
Author
|
Cherry picked the latter, the former is not relevant as there are no typehints in this branch. |
PHP 8.4 deprecates passing `E_USER_ERROR` to `trigger_error()`, with the recommendation being to replace these type of calls with either an Exception or an `exit` statement. This commit fixes an instance found in the autoloader by changing it to a call to `exit`, which considering it is an error related to the autoloader not being registered seems the most appropriate. Ref: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_error_to_trigger_error (cherry picked from commit 926974a)
PHP 8.4 deprecates passing `E_USER_ERROR` to `trigger_error()`, with the recommendation being to replace these type of calls with either an Exception or an `exit` statement. This commit fixes another instance of this issue. In this case, the call to `trigger_error()` is replaced by throwing a generic `SimplePie\Exception` for the same. Ref: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_error_to_trigger_error (cherry picked from commit 24786a7)
PHP 8.4 deprecates passing `E_USER_ERROR` to `trigger_error()`, with the recommendation being to replace these type of calls with either an Exception or an `exit` statement. This commit fixes the last instance of this issue. In this case, the call to `trigger_error()` is also replaced by throwing a generic `SimplePie\Exception` for the same. Ref: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_error_to_trigger_error (cherry picked from commit 7f2fd6c)
... the call to `trigger_error()` would now throw a PHP notice, but with the `die()` after it, with still kill the program anyhow, so we may as well, exit with the error message and remove the `trigger_error()` function call completely. (cherry picked from commit 2a05361)
28ec26a to
35f0278
Compare
Member
Author
Contributor
1c7f003 to
c5d5187
Compare
Member
Author
|
Okay, opened #886 and moved the chnagelog + constant there. |
Contributor
Sorry to correct you, but you're wrong. The IRI class may not have type declarations in 1.8, the Line 135 in c5d5187 - public function pass_cache_data($enable_cache = true, $cache_location = './cache', $cache_name_function = 'md5', $cache_class = 'SimplePie\Cache', DataCache $cache = null)
+ public function pass_cache_data($enable_cache = true, $cache_location = './cache', $cache_name_function = 'md5', $cache_class = 'SimplePie\Cache', ?DataCache $cache = null)Unless this change is backported, you'll have 998 failing tests on PHP 8.4 for the SimplePie 1.8 branch. |
Member
Author
|
Oops, I did not scroll far enough in merge conflict resolution. Opened #888 |
pento
pushed a commit
to WordPress/wordpress-develop
that referenced
this pull request
Sep 30, 2024
The most notable change in this update is that all code is now namespaced and uses PSR-4 classes, though there is a compatibility layer available for extenders using the older class names, so plugin or theme authors directly using SimplePie can decide for themselves when they want to change to using the namespaced names for SimplePie classes. Note: This commit includes additional fixes for PHP 8.4 compatibility ([simplepie/simplepie#875 PR 875], [simplepie/simplepie#888 PR 888]) from the `one-dot-eight` branch of SimplePie, which is expected to be [simplepie/simplepie#886 released as SimplePie 1.8.1] soon. References: * [https://github.com/simplepie/simplepie/releases/tag/1.8.0 SimplePie 1.8.0 release notes] * [https://github.com/simplepie/simplepie/releases/tag/1.7.0 SimplePie 1.7.0 release notes] * [https://github.com/simplepie/simplepie/releases/tag/1.6.0 SimplePie 1.6.0 release notes] * [simplepie/simplepie@1.5.8...1.8.0 Full list of changes in SimplePie 1.8.0] Follow-up to [47733], [49176], [52393], [52413]. Props jrf, peterwilsoncc, chaion07, cu121, markparnell, audrasjb, costdev, Presskopp, desrosj, faisal03, mukesh27, SergeyBiryukov. See #55604. git-svn-id: https://develop.svn.wordpress.org/trunk@59141 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith
pushed a commit
to markjaquith/WordPress
that referenced
this pull request
Sep 30, 2024
The most notable change in this update is that all code is now namespaced and uses PSR-4 classes, though there is a compatibility layer available for extenders using the older class names, so plugin or theme authors directly using SimplePie can decide for themselves when they want to change to using the namespaced names for SimplePie classes. Note: This commit includes additional fixes for PHP 8.4 compatibility ([simplepie/simplepie#875 PR 875], [simplepie/simplepie#888 PR 888]) from the `one-dot-eight` branch of SimplePie, which is expected to be [simplepie/simplepie#886 released as SimplePie 1.8.1] soon. References: * [https://github.com/simplepie/simplepie/releases/tag/1.8.0 SimplePie 1.8.0 release notes] * [https://github.com/simplepie/simplepie/releases/tag/1.7.0 SimplePie 1.7.0 release notes] * [https://github.com/simplepie/simplepie/releases/tag/1.6.0 SimplePie 1.6.0 release notes] * [simplepie/simplepie@1.5.8...1.8.0 Full list of changes in SimplePie 1.8.0] Follow-up to [47733], [49176], [52393], [52413]. Props jrf, peterwilsoncc, chaion07, cu121, markparnell, audrasjb, costdev, Presskopp, desrosj, faisal03, mukesh27, SergeyBiryukov. See #55604. Built from https://develop.svn.wordpress.org/trunk@59141 git-svn-id: http://core.svn.wordpress.org/trunk@58537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
github-actions bot
pushed a commit
to platformsh/wordpress-performance
that referenced
this pull request
Sep 30, 2024
The most notable change in this update is that all code is now namespaced and uses PSR-4 classes, though there is a compatibility layer available for extenders using the older class names, so plugin or theme authors directly using SimplePie can decide for themselves when they want to change to using the namespaced names for SimplePie classes. Note: This commit includes additional fixes for PHP 8.4 compatibility ([simplepie/simplepie#875 PR 875], [simplepie/simplepie#888 PR 888]) from the `one-dot-eight` branch of SimplePie, which is expected to be [simplepie/simplepie#886 released as SimplePie 1.8.1] soon. References: * [https://github.com/simplepie/simplepie/releases/tag/1.8.0 SimplePie 1.8.0 release notes] * [https://github.com/simplepie/simplepie/releases/tag/1.7.0 SimplePie 1.7.0 release notes] * [https://github.com/simplepie/simplepie/releases/tag/1.6.0 SimplePie 1.6.0 release notes] * [simplepie/simplepie@1.5.8...1.8.0 Full list of changes in SimplePie 1.8.0] Follow-up to [47733], [49176], [52393], [52413]. Props jrf, peterwilsoncc, chaion07, cu121, markparnell, audrasjb, costdev, Presskopp, desrosj, faisal03, mukesh27, SergeyBiryukov. See #55604. Built from https://develop.svn.wordpress.org/trunk@59141 git-svn-id: https://core.svn.wordpress.org/trunk@58537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
mattyrob
pushed a commit
to ClassicPress/ClassicPress
that referenced
this pull request
Oct 1, 2024
…n 1.8.0. The most notable change in this update is that all code is now namespaced and uses PSR-4 classes, though there is a compatibility layer available for extenders using the older class names, so plugin or theme authors directly using SimplePie can decide for themselves when they want to change to using the namespaced names for SimplePie classes. Note: This commit includes additional fixes for PHP 8.4 compatibility ([simplepie/simplepie#875 PR 875], [simplepie/simplepie#888 PR 888]) from the `one-dot-eight` branch of SimplePie, which is expected to be [simplepie/simplepie#886 released as SimplePie 1.8.1] soon. References: * [https://github.com/simplepie/simplepie/releases/tag/1.8.0 SimplePie 1.8.0 release notes] * [https://github.com/simplepie/simplepie/releases/tag/1.7.0 SimplePie 1.7.0 release notes] * [https://github.com/simplepie/simplepie/releases/tag/1.6.0 SimplePie 1.6.0 release notes] * [simplepie/simplepie@1.5.8...1.8.0 Full list of changes in SimplePie 1.8.0] Follow-up to https://core.trac.wordpress.org/changeset/47733, https://core.trac.wordpress.org/changeset/49176, https://core.trac.wordpress.org/changeset/52393, https://core.trac.wordpress.org/changeset/52413. WP:Props jrf, peterwilsoncc, chaion07, cu121, markparnell, audrasjb, costdev, Presskopp, desrosj, faisal03, mukesh27, SergeyBiryukov. See https://core.trac.wordpress.org/ticket/55604. Conflicts: - src/wp-includes/class-simplepie.php - src/wp-includes/class-wp-simplepie-file.php --- Merges https://core.trac.wordpress.org/changeset/59141 / WordPress/wordpress-develop@ebfb7649ca to ClassicPress.
aslamdoctor
pushed a commit
to aslamdoctor/wordpress-develop
that referenced
this pull request
Dec 28, 2024
The most notable change in this update is that all code is now namespaced and uses PSR-4 classes, though there is a compatibility layer available for extenders using the older class names, so plugin or theme authors directly using SimplePie can decide for themselves when they want to change to using the namespaced names for SimplePie classes. Note: This commit includes additional fixes for PHP 8.4 compatibility ([simplepie/simplepie#875 PR 875], [simplepie/simplepie#888 PR 888]) from the `one-dot-eight` branch of SimplePie, which is expected to be [simplepie/simplepie#886 released as SimplePie 1.8.1] soon. References: * [https://github.com/simplepie/simplepie/releases/tag/1.8.0 SimplePie 1.8.0 release notes] * [https://github.com/simplepie/simplepie/releases/tag/1.7.0 SimplePie 1.7.0 release notes] * [https://github.com/simplepie/simplepie/releases/tag/1.6.0 SimplePie 1.6.0 release notes] * [simplepie/simplepie@1.5.8...1.8.0 Full list of changes in SimplePie 1.8.0] Follow-up to [47733], [49176], [52393], [52413]. Props jrf, peterwilsoncc, chaion07, cu121, markparnell, audrasjb, costdev, Presskopp, desrosj, faisal03, mukesh27, SergeyBiryukov. See #55604. git-svn-id: https://develop.svn.wordpress.org/trunk@59141 602fd350-edb4-49c9-b593-d223f7449a82
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.