Make WordPress Core


Ignore:
Timestamp:
06/28/2020 06:23:39 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Introduce the spread operator in wp-includes/IXR.

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 kraftbj.
See #48267, #47678.

File:
1 edited

Legend:

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

    r42201 r48204  
    5959        }
    6060
    61     function query()
     61        /**
     62         * @since 1.5.0
     63         * @since 5.5.0 Formalized the existing `...$args` parameter by adding it
     64         *              to the function signature.
     65         */
     66    function query( ...$args )
    6267    {
    63         $args = func_get_args();
    6468        $method = array_shift($args);
    6569        $request = new IXR_Request($method, $args);
Note: See TracChangeset for help on using the changeset viewer.