From 300b14e1ca8d92a09875c0aa989c7b31396b7b46 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 15 Sep 2019 10:36:56 +0000 Subject: [PATCH] Code Modernisation: Introduce the spread operator in `wp-includes/class-wp-dependency.php`. Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable. Props jrf. See #47678. Built from https://develop.svn.wordpress.org/trunk@46124 git-svn-id: http://core.svn.wordpress.org/trunk@45936 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-dependency.php | 6 ++++-- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-dependency.php b/wp-includes/class-wp-dependency.php index fc8099d5b9..12a3b94634 100644 --- a/wp-includes/class-wp-dependency.php +++ b/wp-includes/class-wp-dependency.php @@ -87,9 +87,11 @@ class _WP_Dependency { * Setup dependencies. * * @since 2.6.0 + * + * @param ...$args Dependency information. */ - public function __construct() { - list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = func_get_args(); + public function __construct( ...$args ) { + list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = $args; if ( ! is_array( $this->deps ) ) { $this->deps = array(); } diff --git a/wp-includes/version.php b/wp-includes/version.php index c3ce673c8f..37f561aa71 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-46123'; +$wp_version = '5.3-alpha-46124'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.