From 3372bcfd79d4b357b6871665bf06155515e8d844 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 21 May 2023 15:15:09 +0100 Subject: [PATCH] Fixed calls to deprecated promise functions --- composer.json | 2 +- src/ServiceClient.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 5f91a29..379e59e 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.1", - "phpunit/phpunit": "^8.5.19" + "phpunit/phpunit": "^8.5.19 || ^9.5.8" }, "autoload": { "psr-4": { diff --git a/src/ServiceClient.php b/src/ServiceClient.php index c8118d0..0bfb957 100644 --- a/src/ServiceClient.php +++ b/src/ServiceClient.php @@ -121,7 +121,7 @@ public function executeAllAsync($commands, array $options = []) } // Convert the iterator of commands to a generator of promises. - $commands = Promise\iter_for($commands); + $commands = Promise\Create::iterFor($commands); $promises = function () use ($commands) { foreach ($commands as $key => $command) { if (!$command instanceof CommandInterface) { @@ -166,7 +166,7 @@ public function __call($name, array $args) private function createCommandHandler() { return function (CommandInterface $command) { - return Promise\coroutine(function () use ($command) { + return Promise\Coroutine::of(function () use ($command) { // Prepare the HTTP options. $opts = $command['@http'] ?: []; unset($command['@http']);