Change CoreUpgrader::download_package
signature
#166
Merged
Conversation
How is this called and what is the behavior on older Core versions? I'm wondering whether we might need to support two different versions of the signature to maintain BC... |
Co-authored-by: Alain Schlesser <[email protected]>
The |
TimothyBJacobs
added a commit
to TimothyBJacobs/core-command
that referenced
this pull request
Nov 5, 2020
WordPress 5.5 added a new parameter to `WP_Upgrader::download_package()`. WP-CLI subclasses the `Core_Upgrader` class to customize this behavior. This causes a PHP warning on 7.4 and fatal error on 8.0 if the method signatures do not match. In wp-cli#166 the method signature was adjusted to account for this new parameter, however this causes the same incompatible signature issue on sites running WP versions before 5.5. This commit introduces a trait-based compatibility shim to use the correct method signature depending on the WP version being run. This is patterned off the implementation used in the `FeedbackMethodTrait`.
Please see wp-cli/wp-cli#5494 - This seems related and still an issue, somehow |
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.
wojsmol commentedJul 23, 2020
•
edited
Fixes #167