Skip to content

Commit

Permalink
Connection: Update XMLRPC overload (#16316)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraftbj authored Jun 29, 2020
1 parent abe1753 commit 5d70e19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions packages/connection/legacy/class-jetpack-ixr-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ public function __construct( $args = array(), $path = false, $port = 80, $timeou
/**
* Perform the IXR request.
*
* @param string[] ...$args IXR args.
*
* @return bool True if request succeeded, false otherwise.
*/
public function query() {
$args = func_get_args();
public function query( ...$args ) {
$method = array_shift( $args );
$request = new IXR_Request( $method, $args );
$xml = trim( $request->getXml() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ class Jetpack_IXR_ClientMulticall extends Jetpack_IXR_Client {
* Add a IXR call to the client.
* First argument is the method name.
* The rest of the arguments are the params specified to the method.
*
* @param string[] ...$args IXR args.
*/
public function addCall() {
$args = func_get_args();
public function addCall( ...$args ) {
$method_name = array_shift( $args );
$struct = array(
'methodName' => $method_name,
Expand All @@ -37,9 +38,11 @@ public function addCall() {
/**
* Perform the IXR multicall request.
*
* @param string[] ...$args IXR args.
*
* @return bool True if request succeeded, false otherwise.
*/
public function query() {
public function query( ...$args ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
usort( $this->calls, array( $this, 'sort_calls' ) );

// Prepare multicall, then call the parent::query() method.
Expand Down

0 comments on commit 5d70e19

Please sign in to comment.