Skip to content

Commit a7a36c3

Browse files
committed
Remove empty lines and simplify test.php example
1 parent 18ef4e7 commit a7a36c3

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

test.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
<?php
22
require __DIR__ . '/vendor/autoload.php';
33

4-
use Rcalicdan\FiberAsync\Promise\Interfaces\PromiseInterface;
4+
use Rcalicdan\FiberAsync\Promise\CancellablePromise;
55
use Rcalicdan\FiberAsync\Promise\Promise;
66

7-
$promises = Promise::all([
8-
delay(1),
9-
delay(2),
10-
delay(3),
11-
]);
7+
128

139
$startTime = microtime(true);
14-
run(function () use ($promises) {
10+
run(function () {
11+
$promises = delay(1)->setTimerId();
1512
await($promises);
1613
});
1714

18-
run(function () use ($promises) {
19-
await($promises);
20-
});
2115

2216
$endTime = microtime(true);
2317
$executionTime = $endTime - $startTime;

tests/Unit/CancellablePromiseTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,7 @@
257257
$promise->cancel();
258258

259259
expect($promise->isCancelled())->toBeTrue();
260-
261-
// Test that the chained promise has access to the root cancellable
262-
// (this depends on the internal implementation)
260+
263261
if (method_exists($chainedPromise, 'getRootCancellable')) {
264262
expect($chainedPromise->getRootCancellable())->toBe($promise);
265263
}

0 commit comments

Comments
 (0)