diff options
author | Sergey Biryukov <sergeybiryukov@git.wordpress.org> | 2022-08-29 12:44:30 +0000 |
---|---|---|
committer | Sergey Biryukov <sergeybiryukov@git.wordpress.org> | 2022-08-29 12:44:30 +0000 |
commit | ec9e8ca25dca5a05bad5fe6cb69e608c482c7238 (patch) | |
tree | f8830ff2cdaebc3d6104386502ecde308312b589 /src/wp-admin/includes/class-wp-ajax-upgrader-skin.php | |
parent | 1d456706549ccf4f0cc867b8a17d1dceaabf8a77 (diff) | |
download | wordpress-ec9e8ca25dca5a05bad5fe6cb69e608c482c7238.tar.gz wordpress-ec9e8ca25dca5a05bad5fe6cb69e608c482c7238.zip |
Code Modernization: Explicitly declare all properties in `WP_Ajax_Upgrader_Skin`.
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.
In this case, the `$plugin_info` and `$theme_info` properties are set in `Plugin_Upgrader::bulk_upgrade()` and `Theme_Upgrader::bulk_upgrade()` specifically.
The `Bulk_Plugin_Upgrader_Skin` class and the `Bulk_Theme_Upgrader_Skin` class both already allow for this, but the `wp_ajax_update_plugin()` and `wp_ajax_update_theme()` functions also call the `*_Upgrader::bulk_upgrade()` methods, so the `WP_Ajax_Upgrader_Skin` class also needs to have these properties explicitly declared.
Includes adding proper DocBlocks for the pre-existing properties in the `Bulk_Plugin_Upgrader_Skin` and the `Bulk_Theme_Upgrader_Skin` classes.
Follow-up to [13686], [37714], [38199], [42677], [42873], [53557], [53558], [53850], [53851], [53852], [53853], [53854], [53856], [53916], [53935], [53936], [53937], [53938], [53942], [53945], [53948], [53949].
Props jrf, costdev.
See #56033.
git-svn-id: https://develop.svn.wordpress.org/trunk@53952 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'src/wp-admin/includes/class-wp-ajax-upgrader-skin.php')
-rw-r--r-- | src/wp-admin/includes/class-wp-ajax-upgrader-skin.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php b/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php index bb5a961251..a3b2f9aaef 100644 --- a/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php +++ b/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php @@ -19,6 +19,27 @@ class WP_Ajax_Upgrader_Skin extends Automatic_Upgrader_Skin { /** + * Plugin info. + * + * The Plugin_Upgrader::bulk_upgrade() method will fill this in + * with info retrieved from the get_plugin_data() function. + * + * @var array Plugin data. Values will be empty if not supplied by the plugin. + */ + public $plugin_info = array(); + + /** + * Theme info. + * + * The Theme_Upgrader::bulk_upgrade() method will fill this in + * with info retrieved from the Theme_Upgrader::theme_info() method, + * which in turn calls the wp_get_theme() function. + * + * @var WP_Theme|false The theme's info object, or false. + */ + public $theme_info = false; + + /** * Holds the WP_Error object. * * @since 4.6.0 |