diff --git a/packages/connection/legacy/class-jetpack-ixr-client.php b/packages/connection/legacy/class-jetpack-ixr-client.php index 084cc8e6f14d2..60ff358c59e07 100644 --- a/packages/connection/legacy/class-jetpack-ixr-client.php +++ b/packages/connection/legacy/class-jetpack-ixr-client.php @@ -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() ); diff --git a/packages/connection/legacy/class-jetpack-ixr-clientmulticall.php b/packages/connection/legacy/class-jetpack-ixr-clientmulticall.php index da71873f87d9c..5e155b5e1a378 100644 --- a/packages/connection/legacy/class-jetpack-ixr-clientmulticall.php +++ b/packages/connection/legacy/class-jetpack-ixr-clientmulticall.php @@ -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, @@ -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.