Skip to content

Commit 16ef2c2

Browse files
committed
Remove lingering instances of call time pass-by-reference, limited to instances of callable - use $this instead of &$this.
Props jdgrimes. See #25160. git-svn-id: https://develop.svn.wordpress.org/trunk@25254 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 2151159 commit 16ef2c2

20 files changed

Lines changed: 112 additions & 112 deletions

src/wp-admin/custom-background.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ function init() {
6767
if ( ! current_user_can('edit_theme_options') )
6868
return;
6969

70-
$this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array(&$this, 'admin_page'));
70+
$this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array($this, 'admin_page'));
7171

72-
add_action("load-$page", array(&$this, 'admin_load'));
73-
add_action("load-$page", array(&$this, 'take_action'), 49);
74-
add_action("load-$page", array(&$this, 'handle_upload'), 49);
72+
add_action("load-$page", array($this, 'admin_load'));
73+
add_action("load-$page", array($this, 'take_action'), 49);
74+
add_action("load-$page", array($this, 'handle_upload'), 49);
7575

7676
if ( $this->admin_header_callback )
7777
add_action("admin_head-$page", $this->admin_header_callback, 51);

src/wp-admin/custom-header.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ function init() {
8484
if ( ! current_user_can('edit_theme_options') )
8585
return;
8686

87-
$this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array(&$this, 'admin_page'));
87+
$this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array($this, 'admin_page'));
8888

89-
add_action("admin_print_scripts-$page", array(&$this, 'js_includes'));
90-
add_action("admin_print_styles-$page", array(&$this, 'css_includes'));
91-
add_action("admin_head-$page", array(&$this, 'help') );
92-
add_action("admin_head-$page", array(&$this, 'take_action'), 50);
93-
add_action("admin_head-$page", array(&$this, 'js'), 50);
89+
add_action("admin_print_scripts-$page", array($this, 'js_includes'));
90+
add_action("admin_print_styles-$page", array($this, 'css_includes'));
91+
add_action("admin_head-$page", array($this, 'help') );
92+
add_action("admin_head-$page", array($this, 'take_action'), 50);
93+
add_action("admin_head-$page", array($this, 'js'), 50);
9494
if ( $this->admin_header_callback )
9595
add_action("admin_head-$page", $this->admin_header_callback, 51);
9696
}

src/wp-admin/includes/class-wp-importer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function cmpr_strlen( $a, $b ) {
179179
*/
180180
function get_page( $url, $username = '', $password = '', $head = false ) {
181181
// Increase the timeout
182-
add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) );
182+
add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) );
183183

184184
$headers = array();
185185
$args = array();

src/wp-admin/includes/class-wp-list-table.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function __construct( $args = array() ) {
8787

8888
$this->screen = convert_to_screen( $args['screen'] );
8989

90-
add_filter( "manage_{$this->screen->id}_columns", array( &$this, 'get_columns' ), 0 );
90+
add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
9191

9292
if ( !$args['plural'] )
9393
$args['plural'] = $this->screen->base;
@@ -99,7 +99,7 @@ function __construct( $args = array() ) {
9999

100100
if ( $args['ajax'] ) {
101101
// wp_enqueue_script( 'list-table' );
102-
add_action( 'admin_footer', array( &$this, '_js_vars' ) );
102+
add_action( 'admin_footer', array( $this, '_js_vars' ) );
103103
}
104104
}
105105

@@ -857,7 +857,7 @@ function single_row_columns( $item ) {
857857
}
858858
elseif ( method_exists( $this, 'column_' . $column_name ) ) {
859859
echo "<td $attributes>";
860-
echo call_user_func( array( &$this, 'column_' . $column_name ), $item );
860+
echo call_user_func( array( $this, 'column_' . $column_name ), $item );
861861
echo "</td>";
862862
}
863863
else {

src/wp-admin/includes/class-wp-ms-themes-list-table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function prepare_items() {
8484

8585
if ( $s ) {
8686
$status = 'search';
87-
$themes['search'] = array_filter( array_merge( $themes['all'], $themes['broken'] ), array( &$this, '_search_callback' ) );
87+
$themes['search'] = array_filter( array_merge( $themes['all'], $themes['broken'] ), array( $this, '_search_callback' ) );
8888
}
8989

9090
$totals = array();
@@ -108,7 +108,7 @@ function prepare_items() {
108108
if ( 'ASC' == $order )
109109
$this->items = array_reverse( $this->items );
110110
} else {
111-
uasort( $this->items, array( &$this, '_order_callback' ) );
111+
uasort( $this->items, array( $this, '_order_callback' ) );
112112
}
113113
}
114114

src/wp-admin/includes/class-wp-plugins-list-table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function prepare_items() {
9999

100100
if ( $s ) {
101101
$status = 'search';
102-
$plugins['search'] = array_filter( $plugins['all'], array( &$this, '_search_callback' ) );
102+
$plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) );
103103
}
104104

105105
$totals = array();
@@ -121,7 +121,7 @@ function prepare_items() {
121121
$orderby = ucfirst( $orderby );
122122
$order = strtoupper( $order );
123123

124-
uasort( $this->items, array( &$this, '_order_callback' ) );
124+
uasort( $this->items, array( $this, '_order_callback' ) );
125125
}
126126

127127
$plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ), 999 );

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

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ function install($package) {
403403
$this->init();
404404
$this->install_strings();
405405

406-
add_filter('upgrader_source_selection', array(&$this, 'check_package') );
406+
add_filter('upgrader_source_selection', array($this, 'check_package') );
407407

408408
$this->run(array(
409409
'package' => $package,
@@ -413,7 +413,7 @@ function install($package) {
413413
'hook_extra' => array()
414414
));
415415

416-
remove_filter('upgrader_source_selection', array(&$this, 'check_package') );
416+
remove_filter('upgrader_source_selection', array($this, 'check_package') );
417417

418418
if ( ! $this->result || is_wp_error($this->result) )
419419
return $this->result;
@@ -443,9 +443,9 @@ function upgrade($plugin) {
443443
// Get the URL to the zip file
444444
$r = $current->response[ $plugin ];
445445

446-
add_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'), 10, 2);
447-
add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4);
448-
//'source_selection' => array(&$this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins.
446+
add_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'), 10, 2);
447+
add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4);
448+
//'source_selection' => array($this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins.
449449

450450
$this->run(array(
451451
'package' => $r->package,
@@ -458,8 +458,8 @@ function upgrade($plugin) {
458458
));
459459

460460
// Cleanup our hooks, in case something else does a upgrade on this connection.
461-
remove_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'));
462-
remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'));
461+
remove_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'));
462+
remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'));
463463

464464
if ( ! $this->result || is_wp_error($this->result) )
465465
return $this->result;
@@ -480,7 +480,7 @@ function bulk_upgrade($plugins) {
480480

481481
$current = get_site_transient( 'update_plugins' );
482482

483-
add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4);
483+
add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4);
484484

485485
$this->skin->header();
486486

@@ -550,7 +550,7 @@ function bulk_upgrade($plugins) {
550550
$this->skin->footer();
551551

552552
// Cleanup our hooks, in case something else does a upgrade on this connection.
553-
remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'));
553+
remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'));
554554

555555
// Force refresh of plugin update information
556556
delete_site_transient('update_plugins');
@@ -712,7 +712,7 @@ function check_parent_theme_filter($install_result, $hook_extra, $child_result)
712712
if ( ! $api || is_wp_error($api) ) {
713713
$this->skin->feedback( 'parent_theme_not_found', $theme_info->get('Template') );
714714
// Don't show activate or preview actions after install
715-
add_filter('install_theme_complete_actions', array(&$this, 'hide_activate_preview_actions') );
715+
add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions') );
716716
return $install_result;
717717
}
718718

@@ -737,7 +737,7 @@ function check_parent_theme_filter($install_result, $hook_extra, $child_result)
737737
) );
738738

739739
if ( is_wp_error($parent_result) )
740-
add_filter('install_theme_complete_actions', array(&$this, 'hide_activate_preview_actions') );
740+
add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions') );
741741

742742
// Start cleaning up after the parents installation
743743
remove_filter('install_theme_complete_actions', '__return_false', 999);
@@ -760,8 +760,8 @@ function install($package) {
760760
$this->init();
761761
$this->install_strings();
762762

763-
add_filter('upgrader_source_selection', array(&$this, 'check_package') );
764-
add_filter('upgrader_post_install', array(&$this, 'check_parent_theme_filter'), 10, 3);
763+
add_filter('upgrader_source_selection', array($this, 'check_package') );
764+
add_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'), 10, 3);
765765

766766
$options = array(
767767
'package' => $package,
@@ -772,8 +772,8 @@ function install($package) {
772772

773773
$this->run($options);
774774

775-
remove_filter('upgrader_source_selection', array(&$this, 'check_package') );
776-
remove_filter('upgrader_post_install', array(&$this, 'check_parent_theme_filter'));
775+
remove_filter('upgrader_source_selection', array($this, 'check_package') );
776+
remove_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'));
777777

778778
if ( ! $this->result || is_wp_error($this->result) )
779779
return $this->result;
@@ -802,9 +802,9 @@ function upgrade($theme) {
802802

803803
$r = $current->response[ $theme ];
804804

805-
add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2);
806-
add_filter('upgrader_post_install', array(&$this, 'current_after'), 10, 2);
807-
add_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4);
805+
add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2);
806+
add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2);
807+
add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4);
808808

809809
$options = array(
810810
'package' => $r['package'],
@@ -818,9 +818,9 @@ function upgrade($theme) {
818818

819819
$this->run($options);
820820

821-
remove_filter('upgrader_pre_install', array(&$this, 'current_before'));
822-
remove_filter('upgrader_post_install', array(&$this, 'current_after'));
823-
remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'));
821+
remove_filter('upgrader_pre_install', array($this, 'current_before'));
822+
remove_filter('upgrader_post_install', array($this, 'current_after'));
823+
remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme'));
824824

825825
if ( ! $this->result || is_wp_error($this->result) )
826826
return $this->result;
@@ -840,9 +840,9 @@ function bulk_upgrade($themes) {
840840

841841
$current = get_site_transient( 'update_themes' );
842842

843-
add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2);
844-
add_filter('upgrader_post_install', array(&$this, 'current_after'), 10, 2);
845-
add_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4);
843+
add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2);
844+
add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2);
845+
add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4);
846846

847847
$this->skin->header();
848848

@@ -912,9 +912,9 @@ function bulk_upgrade($themes) {
912912
$this->skin->footer();
913913

914914
// Cleanup our hooks, in case something else does a upgrade on this connection.
915-
remove_filter('upgrader_pre_install', array(&$this, 'current_before'));
916-
remove_filter('upgrader_post_install', array(&$this, 'current_after'));
917-
remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'));
915+
remove_filter('upgrader_pre_install', array($this, 'current_before'));
916+
remove_filter('upgrader_post_install', array($this, 'current_after'));
917+
remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme'));
918918

919919
// Force refresh of theme update information
920920
wp_clean_themes_cache();

src/wp-admin/includes/list-table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function _WP_List_Table_Compat( $screen, $columns = array() ) {
9595

9696
if ( !empty( $columns ) ) {
9797
$this->_columns = $columns;
98-
add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 );
98+
add_filter( 'manage_' . $screen->id . '_columns', array( $this, 'get_columns' ), 0 );
9999
}
100100
}
101101

tests/phpunit/includes/utils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ function testXMLParser($in) {
133133
$this->xml = xml_parser_create();
134134
xml_set_object($this->xml, $this);
135135
xml_parser_set_option($this->xml,XML_OPTION_CASE_FOLDING, 0);
136-
xml_set_element_handler($this->xml, array(&$this, 'startHandler'), array(&$this, 'endHandler'));
137-
xml_set_character_data_handler($this->xml, array(&$this, 'dataHandler'));
136+
xml_set_element_handler($this->xml, array($this, 'startHandler'), array($this, 'endHandler'));
137+
xml_set_character_data_handler($this->xml, array($this, 'dataHandler'));
138138
$this->parse($in);
139139
}
140140

tests/phpunit/includes/wp-profiler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function start($name) {
3232

3333
if (!$this->stack) {
3434
// log all actions and filters
35-
add_filter('all', array(&$this, 'log_filter'));
35+
add_filter('all', array($this, 'log_filter'));
3636
}
3737

3838
// reset the wpdb queries log, storing it on the profile stack if necessary
@@ -101,7 +101,7 @@ function stop() {
101101
}
102102

103103
if (!$this->stack) {
104-
remove_filter('all', array(&$this, 'log_filter'));
104+
remove_filter('all', array($this, 'log_filter'));
105105
}
106106
}
107107

0 commit comments

Comments
 (0)