From aa8b23c039d44c53fc9a0814a9d179fbca5ff615 Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Thu, 2 Dec 2021 17:49:48 -0600 Subject: [PATCH] Update a few remaining callable refs to Closure --- src/Internal/Cancellable.php | 2 +- src/functions.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Internal/Cancellable.php b/src/Internal/Cancellable.php index cdf5008..29ded28 100644 --- a/src/Internal/Cancellable.php +++ b/src/Internal/Cancellable.php @@ -15,7 +15,7 @@ final class Cancellable implements Cancellation { private string $nextId = "a"; - /** @var callable[] */ + /** @var \Closure[] */ private array $callbacks = []; private ?CancelledException $exception = null; diff --git a/src/functions.php b/src/functions.php index de1a057..ce0e3a1 100644 --- a/src/functions.php +++ b/src/functions.php @@ -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); }