Skip to content

Commit 354a2ec

Browse files
committed
Remove deprecated future combinators
1 parent f682341 commit 354a2ec

File tree

1 file changed

+0
-99
lines changed

1 file changed

+0
-99
lines changed

src/Future/functions.php

-99
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,6 @@ function awaitFirst(iterable $futures, ?Cancellation $cancellation = null): mixe
3030
throw new CompositeLengthException('Argument #1 ($futures) is empty');
3131
}
3232

33-
/**
34-
* Unwraps the first completed future.
35-
*
36-
* If you want the first future completed without an error, use {@see any()} instead.
37-
*
38-
* @template T
39-
*
40-
* @param iterable<Future<T>> $futures
41-
* @param Cancellation|null $cancellation Optional cancellation.
42-
*
43-
* @return T
44-
*
45-
* @throws CompositeLengthException If $futures is empty.
46-
*
47-
* @deprecated Use {@see awaitFirst()} instead.
48-
*/
49-
function race(iterable $futures, ?Cancellation $cancellation = null): mixed
50-
{
51-
return awaitFirst($futures, $cancellation);
52-
}
53-
5433
/**
5534
* Awaits the first successfully completed future, ignoring errors.
5635
*
@@ -73,29 +52,6 @@ function awaitAny(iterable $futures, ?Cancellation $cancellation = null): mixed
7352
return $result[\array_key_first($result)];
7453
}
7554

76-
/**
77-
* Awaits the first successfully completed future, ignoring errors.
78-
*
79-
* If you want the first future completed, successful or not, use {@see awaitFirst()} instead.
80-
*
81-
* @template Tk of array-key
82-
* @template Tv
83-
*
84-
* @param iterable<Tk, Future<Tv>> $futures
85-
* @param Cancellation|null $cancellation Optional cancellation.
86-
*
87-
* @return Tv
88-
*
89-
* @throws CompositeException If all futures errored.
90-
* @throws CompositeLengthException If {@code $futures} is empty.
91-
*
92-
* @deprecated Use {@see awaitFirst()} instead.
93-
*/
94-
function any(iterable $futures, ?Cancellation $cancellation = null): mixed
95-
{
96-
return awaitAny($futures, $cancellation);
97-
}
98-
9955
/**
10056
* Awaits the first N successfully completed futures, ignoring errors.
10157
*
@@ -141,26 +97,6 @@ function awaitAnyN(int $count, iterable $futures, ?Cancellation $cancellation =
14197
throw new CompositeException($errors);
14298
}
14399

144-
/**
145-
* @template Tk of array-key
146-
* @template Tv
147-
*
148-
* @param iterable<Tk, Future<Tv>> $futures
149-
* @param positive-int $count
150-
* @param Cancellation|null $cancellation Optional cancellation.
151-
*
152-
* @return non-empty-array<Tk, Tv>
153-
*
154-
* @throws CompositeException If all futures errored.
155-
* @throws CompositeLengthException If {@code $futures} is empty.
156-
*
157-
* @deprecated Use {@see awaitAnyN()} instead.
158-
*/
159-
function some(iterable $futures, int $count, ?Cancellation $cancellation = null): array
160-
{
161-
return awaitAnyN($count, $futures, $cancellation);
162-
}
163-
164100
/**
165101
* Awaits all futures to complete or error.
166102
*
@@ -190,22 +126,6 @@ function awaitAll(iterable $futures, ?Cancellation $cancellation = null): array
190126
return [$errors, $values];
191127
}
192128

193-
/**
194-
* @template Tk of array-key
195-
* @template Tv
196-
*
197-
* @param iterable<Tk, Future<Tv>> $futures
198-
* @param Cancellation|null $cancellation Optional cancellation.
199-
*
200-
* @return array{array<Tk, \Throwable>, array<Tk, Tv>}
201-
*
202-
* @deprecated Use {@see awaitAll()} instead.
203-
*/
204-
function settle(iterable $futures, ?Cancellation $cancellation = null): array
205-
{
206-
return awaitAll($futures, $cancellation);
207-
}
208-
209129
/**
210130
* Awaits all futures to complete or aborts if any errors.
211131
*
@@ -235,22 +155,3 @@ function await(iterable $futures, ?Cancellation $cancellation = null): array
235155
/** @var array<Tk, Tv> */
236156
return $values;
237157
}
238-
239-
/**
240-
* Awaits all futures to complete or aborts if any errors. The returned array keys will be in the order the futures
241-
* resolved, not in the order given by the iterable. Sort the array after resolution if necessary.
242-
*
243-
* @template Tk of array-key
244-
* @template Tv
245-
*
246-
* @param iterable<Tk, Future<Tv>> $futures
247-
* @param Cancellation|null $cancellation Optional cancellation.
248-
*
249-
* @return array<Tk, Tv> Unwrapped values with the order preserved.
250-
*
251-
* @deprecated Use {@see await()} instead.
252-
*/
253-
function all(iterable $futures, ?Cancellation $cancellation = null): array
254-
{
255-
return await($futures, $cancellation);
256-
}

0 commit comments

Comments
 (0)