Code Modernization: Introduce the spread operator in `WP_HTTP_IXR_Client`.
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. This makes the signature of `WP_HTTP_IXR_Client::query()` compatible with the parent class method. Follow-up to [48204]. Props ayeshrajans. See #48267, #47678. Built from https://develop.svn.wordpress.org/trunk@48238 git-svn-id: http://core.svn.wordpress.org/trunk@48007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e92ab44880
commit
6cb2f5491b
|
@ -62,6 +62,8 @@ class IXR_Client
|
||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @since 5.5.0 Formalized the existing `...$args` parameter by adding it
|
* @since 5.5.0 Formalized the existing `...$args` parameter by adding it
|
||||||
* to the function signature.
|
* to the function signature.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function query( ...$args )
|
function query( ...$args )
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,6 +44,8 @@ class IXR_ClientMulticall extends IXR_Client
|
||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @since 5.5.0 Formalized the existing `...$args` parameter by adding it
|
* @since 5.5.0 Formalized the existing `...$args` parameter by adding it
|
||||||
* to the function signature.
|
* to the function signature.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function query( ...$args )
|
function query( ...$args )
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,10 +46,13 @@ class WP_HTTP_IXR_Client extends IXR_Client {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @since 3.1.0
|
||||||
|
* @since 5.5.0 Formalized the existing `...$args` parameter by adding it
|
||||||
|
* to the function signature.
|
||||||
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function query() {
|
public function query( ...$args ) {
|
||||||
$args = func_get_args();
|
|
||||||
$method = array_shift( $args );
|
$method = array_shift( $args );
|
||||||
$request = new IXR_Request( $method, $args );
|
$request = new IXR_Request( $method, $args );
|
||||||
$xml = $request->getXml();
|
$xml = $request->getXml();
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.5-alpha-48237';
|
$wp_version = '5.5-alpha-48238';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue