Make WordPress Core

Changeset 47355


Ignore:
Timestamp:
02/25/2020 12:57:33 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Script Loader: Remove unnecessary reference sign from function definitions in script loader.

This resolves PHP warnings when extensions like php_uopz or php_tideways_xhprof are in use.

Object variables in PHP 5+ contain a reference to the object, and it's the reference that's passed around.

Props jqz, killerbishop, Mte90, TJNowell, jorbin, pento, pcarvalho, valentinbora, SergeyBiryukov.
Fixes #44979.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r47353 r47355  
    4242 * @param WP_Scripts $scripts WP_Scripts object.
    4343 */
    44 function wp_register_tinymce_scripts( &$scripts, $force_uncompressed = false ) {
     44function wp_register_tinymce_scripts( $scripts, $force_uncompressed = false ) {
    4545    global $tinymce_version, $concatenate_scripts, $compress_scripts;
    4646    $suffix     = wp_scripts_get_suffix();
     
    7474 * @param WP_Scripts $scripts WP_Scripts object.
    7575 */
    76 function wp_default_packages_vendor( &$scripts ) {
     76function wp_default_packages_vendor( $scripts ) {
    7777    global $wp_locale;
    7878
     
    177177 * @return string Conditional polyfill inline script.
    178178 */
    179 function wp_get_script_polyfill( &$scripts, $tests ) {
     179function wp_get_script_polyfill( $scripts, $tests ) {
    180180    $polyfill = '';
    181181    foreach ( $tests as $test => $handle ) {
     
    229229 * @param WP_Scripts $scripts WP_Scripts object.
    230230 */
    231 function wp_default_packages_scripts( &$scripts ) {
     231function wp_default_packages_scripts( $scripts ) {
    232232    $suffix = wp_scripts_get_suffix();
    233233
     
    274274 * @param WP_Scripts $scripts WP_Scripts object.
    275275 */
    276 function wp_default_packages_inline_scripts( &$scripts ) {
     276function wp_default_packages_inline_scripts( $scripts ) {
    277277    global $wp_locale;
    278278
     
    522522 * @param WP_Scripts $scripts WP_Scripts object.
    523523 */
    524 function wp_default_packages( &$scripts ) {
     524function wp_default_packages( $scripts ) {
    525525    wp_default_packages_vendor( $scripts );
    526526    wp_register_tinymce_scripts( $scripts );
     
    581581 * @param WP_Scripts $scripts WP_Scripts object.
    582582 */
    583 function wp_default_scripts( &$scripts ) {
     583function wp_default_scripts( $scripts ) {
    584584    $suffix     = wp_scripts_get_suffix();
    585585    $dev_suffix = wp_scripts_get_suffix( 'dev' );
     
    16161616 * @param WP_Styles $styles
    16171617 */
    1618 function wp_default_styles( &$styles ) {
     1618function wp_default_styles( $styles ) {
    16191619    // Include an unmodified $wp_version.
    16201620    require ABSPATH . WPINC . '/version.php';
Note: See TracChangeset for help on using the changeset viewer.