mirror of
https://github.com/danog/amp.git
synced 2024-12-03 09:57:51 +01:00
Update a few remaining callable refs to Closure
This commit is contained in:
parent
18b0348ddc
commit
aa8b23c039
@ -15,7 +15,7 @@ final class Cancellable implements Cancellation
|
||||
{
|
||||
private string $nextId = "a";
|
||||
|
||||
/** @var callable[] */
|
||||
/** @var \Closure[] */
|
||||
private array $callbacks = [];
|
||||
|
||||
private ?CancelledException $exception = null;
|
||||
|
@ -20,9 +20,9 @@ function async(\Closure $closure): Future
|
||||
{
|
||||
static $run = null;
|
||||
|
||||
$run ??= static function (FutureState $state, callable $callback) {
|
||||
$run ??= static function (FutureState $state, \Closure $closure): void {
|
||||
try {
|
||||
$state->complete($callback());
|
||||
$state->complete($closure());
|
||||
} catch (\Throwable $exception) {
|
||||
$state->error($exception);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user