Make WordPress Core


Ignore:
Timestamp:
06/30/2020 07:48:48 PM (6 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-http-ixr-client.php

    r47219 r48238  
    4747
    4848    /**
     49     * @since 3.1.0
     50     * @since 5.5.0 Formalized the existing `...$args` parameter by adding it
     51     *              to the function signature.
     52     *
    4953     * @return bool
    5054     */
    51     public function query() {
    52         $args    = func_get_args();
     55    public function query( ...$args ) {
    5356        $method  = array_shift( $args );
    5457        $request = new IXR_Request( $method, $args );
Note: See TracChangeset for help on using the changeset viewer.