From 252624c0f6ecc0887583607e567f41aee1e9c51d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20=C4=8Cern=C3=BD?= Date: Fri, 5 Apr 2024 18:07:20 +0200 Subject: [PATCH] Fix undefined function GuzzleHttp\Promise\unwrap() --- src/FacebookAds/Object/ServerSide/BatchProcessor.php | 6 +++--- .../Object/ServerSide/BatchProcessorTest.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/FacebookAds/Object/ServerSide/BatchProcessor.php b/src/FacebookAds/Object/ServerSide/BatchProcessor.php index 8f3bbd13f..e8663f0ec 100644 --- a/src/FacebookAds/Object/ServerSide/BatchProcessor.php +++ b/src/FacebookAds/Object/ServerSide/BatchProcessor.php @@ -24,7 +24,7 @@ namespace FacebookAds\Object\ServerSide; -use GuzzleHttp\Promise; +use GuzzleHttp\Promise\Utils; class BatchProcessor { protected $batch_size; @@ -53,7 +53,7 @@ public function __construct($pixel_id, $batch_size = 50, $concurrent_requests = public function processEvents($event_request_params, $events) { $generator = $this->processEventsGenerator($event_request_params, $events); foreach ($generator as $promises) { - Promise\unwrap($promises); + Utils::unwrap($promises); } } @@ -94,7 +94,7 @@ public function processEventsGenerator($event_request_params, $events) { public function processEventRequests($event_requests_async) { $generator = $this->processEventRequestsGenerator($event_requests_async); foreach ($generator as $promises) { - Promise\unwrap($promises); + Utils::unwrap($promises); } } diff --git a/test/FacebookAdsTest/Object/ServerSide/BatchProcessorTest.php b/test/FacebookAdsTest/Object/ServerSide/BatchProcessorTest.php index 79d8060a0..acc3edc37 100644 --- a/test/FacebookAdsTest/Object/ServerSide/BatchProcessorTest.php +++ b/test/FacebookAdsTest/Object/ServerSide/BatchProcessorTest.php @@ -29,7 +29,7 @@ use FacebookAds\Object\ServerSide\UserData; use FacebookAds\Object\ServerSide\BatchProcessor; use FacebookAds\Api; -use GuzzleHttp\Promise; +use GuzzleHttp\Promise\Utils; use Mockery as m; class BatchProcessorTest extends AbstractUnitTestCase { @@ -114,7 +114,7 @@ public function testProcessEventsGenerator() { $iterations = 0; foreach ($generator as $promises) { $iterations += 1; - Promise\unwrap($promises); + Utils::unwrap($promises); } $this->assertEquals($iterations, 2); @@ -158,7 +158,7 @@ public function testProcessEventRequestsGenerator() { $iterations = 0; foreach ($generator as $promises) { $iterations += 1; - Promise\unwrap($promises); + Utils::unwrap($promises); } $this->assertEquals(3, $iterations);