Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pass by reference PHP warnings due to PHP 4 compatibility hacks inherited from Core #19404

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function gutenberg_url( $path ) {
*
* @since 4.1.0
*
* @param WP_Scripts $scripts WP_Scripts instance (passed by reference).
* @param WP_Scripts $scripts WP_Scripts instance.
* @param string $handle Name of the script. Should be unique.
* @param string $src Full URL of the script, or path of the script relative to the WordPress root directory.
* @param array $deps Optional. An array of registered script handles this script depends on. Default empty array.
Expand All @@ -53,7 +53,7 @@ function gutenberg_url( $path ) {
* @param bool $in_footer Optional. Whether to enqueue the script before </body> instead of in the <head>.
* Default 'false'.
*/
function gutenberg_override_script( &$scripts, $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
function gutenberg_override_script( $scripts, $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
$script = $scripts->query( $handle, 'registered' );
if ( $script ) {
/*
Expand Down Expand Up @@ -174,7 +174,7 @@ function gutenberg_override_posttype_labels( $labels ) {
*
* @since 4.1.0
*
* @param WP_Styles $styles WP_Styles instance (passed by reference).
* @param WP_Styles $styles WP_Styles instance.
* @param string $handle Name of the stylesheet. Should be unique.
* @param string $src Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
* @param array $deps Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array.
Expand All @@ -186,7 +186,7 @@ function gutenberg_override_posttype_labels( $labels ) {
* Default 'all'. Accepts media types like 'all', 'print' and 'screen', or media queries like
* '(orientation: portrait)' and '(max-width: 640px)'.
*/
function gutenberg_override_style( &$styles, $handle, $src, $deps = array(), $ver = false, $media = 'all' ) {
function gutenberg_override_style( $styles, $handle, $src, $deps = array(), $ver = false, $media = 'all' ) {
$style = $styles->query( $handle, 'registered' );
if ( $style ) {
$styles->remove( $handle );
Expand All @@ -203,9 +203,9 @@ function gutenberg_override_style( &$styles, $handle, $src, $deps = array(), $ve
*
* @since 0.1.0
*
* @param WP_Scripts $scripts WP_Scripts instance (passed by reference).
* @param WP_Scripts $scripts WP_Scripts instance.
*/
function gutenberg_register_vendor_scripts( &$scripts ) {
function gutenberg_register_vendor_scripts( $scripts ) {
$suffix = SCRIPT_DEBUG ? '' : '.min';

// Vendor Scripts.
Expand Down Expand Up @@ -246,9 +246,9 @@ function gutenberg_register_vendor_scripts( &$scripts ) {
*
* @since 4.5.0
*
* @param WP_Scripts $scripts WP_Scripts instance (passed by reference).
* @param WP_Scripts $scripts WP_Scripts instance.
*/
function gutenberg_register_packages_scripts( &$scripts ) {
function gutenberg_register_packages_scripts( $scripts ) {
foreach ( glob( gutenberg_dir_path() . 'build/*/index.js' ) as $path ) {
// Prefix `wp-` to package directory to get script handle.
// For example, `…/build/a11y/index.js` becomes `wp-a11y`.
Expand Down Expand Up @@ -298,9 +298,9 @@ function gutenberg_register_packages_scripts( &$scripts ) {
*
* @since 6.7.0

* @param WP_Styles $styles WP_Styles instance (passed by reference).
* @param WP_Styles $styles WP_Styles instance.
*/
function gutenberg_register_packages_styles( &$styles ) {
function gutenberg_register_packages_styles( $styles ) {
// Editor Styles.
gutenberg_override_style(
$styles,
Expand Down Expand Up @@ -494,7 +494,7 @@ function gutenberg_vendor_script_filename( $handle, $src ) {
* possible, or downloading it if the cached version is unavailable or
* outdated.
*
* @param WP_Scripts $scripts WP_Scripts instance (passed by reference).
* @param WP_Scripts $scripts WP_Scripts instance.
* @param string $handle Name of the script.
* @param string $src Full URL of the external script.
* @param array $deps Optional. An array of registered script handles this
Expand All @@ -508,7 +508,7 @@ function gutenberg_vendor_script_filename( $handle, $src ) {
*
* @since 0.1.0
*/
function gutenberg_register_vendor_script( &$scripts, $handle, $src, $deps = array(), $ver = null, $in_footer = false ) {
function gutenberg_register_vendor_script( $scripts, $handle, $src, $deps = array(), $ver = null, $in_footer = false ) {
if ( defined( 'GUTENBERG_LOAD_VENDOR_SCRIPTS' ) && ! GUTENBERG_LOAD_VENDOR_SCRIPTS ) {
return;
}
Expand Down