Make WordPress Core

Ticket #48267: 48267.diff

File 48267.diff, 1.4 KB (added by kraftbj, 5 years ago)

Add spread operator

  • src/wp-includes/IXR/class-IXR-client.php

    diff --git src/wp-includes/IXR/class-IXR-client.php src/wp-includes/IXR/class-IXR-client.php
    index f66bcb30d6..549e494cf6 100644
    class IXR_Client 
    5858                self::__construct( $server, $path, $port, $timeout );
    5959        }
    6060
    61     function query()
     61    function query( ...$args )
    6262    {
    63         $args = func_get_args();
    6463        $method = array_shift($args);
    6564        $request = new IXR_Request($method, $args);
    6665        $length = $request->getLength();
  • src/wp-includes/IXR/class-IXR-clientmulticall.php

    diff --git src/wp-includes/IXR/class-IXR-clientmulticall.php src/wp-includes/IXR/class-IXR-clientmulticall.php
    index bc40efd771..627ab881f3 100644
    class IXR_ClientMulticall extends IXR_Client 
    2525                self::__construct( $server, $path, $port );
    2626        }
    2727
    28     function addCall()
     28    function addCall( ...$args )
    2929    {
    30         $args = func_get_args();
    3130        $methodName = array_shift($args);
    3231        $struct = array(
    3332            'methodName' => $methodName,
    class IXR_ClientMulticall extends IXR_Client 
    3635        $this->calls[] = $struct;
    3736    }
    3837
    39     function query()
     38    function query( ...$args )
    4039    {
    4140        // Prepare multicall, then call the parent::query() method
    4241        return parent::query('system.multicall', $this->calls);