Skip to content

Commit

Permalink
Fix undefined function GuzzleHttp\Promise\unwrap()
Browse files Browse the repository at this point in the history
  • Loading branch information
cvaclav committed Apr 5, 2024
1 parent 6270c85 commit 252624c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/FacebookAds/Object/ServerSide/BatchProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace FacebookAds\Object\ServerSide;

use GuzzleHttp\Promise;
use GuzzleHttp\Promise\Utils;

class BatchProcessor {
protected $batch_size;
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}

Expand Down
6 changes: 3 additions & 3 deletions test/FacebookAdsTest/Object/ServerSide/BatchProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 252624c

Please sign in to comment.