WordPress.org

Make WordPress Core

Ticket #47678: 47678-_WP_Dependency-__construct.patch

File 47678-_WP_Dependency-__construct.patch, 1.0 KB (added by jrf, 12 months ago)

Use spread operator in _WP_Dependency::construct()

  • src/wp-includes/class-wp-dependency.php

    From af40927c7d9914e29e90e77bdb75e6104f846b08 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Thu, 18 Jul 2019 02:33:02 +0200
    Subject: [PATCH] Use spread operator in _WP_Dependency::__construct()
    
    ---
     src/wp-includes/class-wp-dependency.php | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/src/wp-includes/class-wp-dependency.php b/src/wp-includes/class-wp-dependency.php
    index fc8099d5b9..12a3b94634 100644
    a b class _WP_Dependency { 
    8787         * Setup dependencies.
    8888         *
    8989         * @since 2.6.0
     90         *
     91         * @param ...$args Dependency information.
    9092         */
    91         public function __construct() {
    92                 list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = func_get_args();
     93        public function __construct( ...$args ) {
     94                list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = $args;
    9395                if ( ! is_array( $this->deps ) ) {
    9496                        $this->deps = array();
    9597                }