Skip to content

Commit ec9e8ca

Browse files
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
1 parent 1d45670 commit ec9e8ca

3 files changed

Lines changed: 42 additions & 2 deletions

File tree

src/wp-admin/includes/class-bulk-plugin-upgrader-skin.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@
1616
* @see Bulk_Upgrader_Skin
1717
*/
1818
class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
19-
public $plugin_info = array(); // Plugin_Upgrader::bulk_upgrade() will fill this in.
19+
20+
/**
21+
* Plugin info.
22+
*
23+
* The Plugin_Upgrader::bulk_upgrade() method will fill this in
24+
* with info retrieved from the get_plugin_data() function.
25+
*
26+
* @var array Plugin data. Values will be empty if not supplied by the plugin.
27+
*/
28+
public $plugin_info = array();
2029

2130
public function add_strings() {
2231
parent::add_strings();

src/wp-admin/includes/class-bulk-theme-upgrader-skin.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@
1616
* @see Bulk_Upgrader_Skin
1717
*/
1818
class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
19-
public $theme_info = array(); // Theme_Upgrader::bulk_upgrade() will fill this in.
19+
20+
/**
21+
* Theme info.
22+
*
23+
* The Theme_Upgrader::bulk_upgrade() method will fill this in
24+
* with info retrieved from the Theme_Upgrader::theme_info() method,
25+
* which in turn calls the wp_get_theme() function.
26+
*
27+
* @var WP_Theme|false The theme's info object, or false.
28+
*/
29+
public $theme_info = false;
2030

2131
public function add_strings() {
2232
parent::add_strings();

src/wp-admin/includes/class-wp-ajax-upgrader-skin.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@
1818
*/
1919
class WP_Ajax_Upgrader_Skin extends Automatic_Upgrader_Skin {
2020

21+
/**
22+
* Plugin info.
23+
*
24+
* The Plugin_Upgrader::bulk_upgrade() method will fill this in
25+
* with info retrieved from the get_plugin_data() function.
26+
*
27+
* @var array Plugin data. Values will be empty if not supplied by the plugin.
28+
*/
29+
public $plugin_info = array();
30+
31+
/**
32+
* Theme info.
33+
*
34+
* The Theme_Upgrader::bulk_upgrade() method will fill this in
35+
* with info retrieved from the Theme_Upgrader::theme_info() method,
36+
* which in turn calls the wp_get_theme() function.
37+
*
38+
* @var WP_Theme|false The theme's info object, or false.
39+
*/
40+
public $theme_info = false;
41+
2142
/**
2243
* Holds the WP_Error object.
2344
*

0 commit comments

Comments
 (0)