1
0
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:
Aaron Piotrowski 2021-12-02 17:49:48 -06:00
parent 18b0348ddc
commit aa8b23c039
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB
2 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ final class Cancellable implements Cancellation
{
private string $nextId = "a";
/** @var callable[] */
/** @var \Closure[] */
private array $callbacks = [];
private ?CancelledException $exception = null;

View File

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