[wp-trac] [WordPress Trac] #50670: Upgrader implementation ignore UpgraderSkin interfaces
WordPress Trac
noreply at wordpress.org
Wed Jul 15 15:54:46 UTC 2020
#50670: Upgrader implementation ignore UpgraderSkin interfaces
--------------------------+--------------------
Reporter: schlessera | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.5
Component: Plugins | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+--------------------
The new Upgrader implementations like `Plugin_Upgrader` don't stick to the
interfaces they claim to use in terms of the `WP_Upgrader_Skin` and just
directly access properties like `$overwrite` that are only declared for
_some_ implementations.
This is a violation of the open/closed principle and cause code that
already extends the `UpgraderSkin` to break. An example of this can be
found here: https://travis-ci.org/github/wp-cli/wp-
cli/jobs/708222192#L505-L511
The code should either first check whether the properties/methods that are
not part of the interface are actually available or not, or it should only
accept specific implementations, or an adapted interface.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50670>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list