diff --git a/src/DeferredCancellation.php b/src/DeferredCancellation.php index 97b05be..6915f80 100644 --- a/src/DeferredCancellation.php +++ b/src/DeferredCancellation.php @@ -37,8 +37,8 @@ namespace Amp; */ final class DeferredCancellation { - private Internal\Cancellable $source; - private Cancellation $cancellation; + private readonly Internal\Cancellable $source; + private readonly Cancellation $cancellation; public function __construct() { diff --git a/src/DeferredFuture.php b/src/DeferredFuture.php index 9f85e95..583653e 100644 --- a/src/DeferredFuture.php +++ b/src/DeferredFuture.php @@ -8,10 +8,10 @@ namespace Amp; final class DeferredFuture { /** @var Internal\FutureState */ - private Internal\FutureState $state; + private readonly Internal\FutureState $state; /** @var Future */ - private Future $future; + private readonly Future $future; public function __construct() { diff --git a/src/Future.php b/src/Future.php index bde5ae9..52b9c03 100644 --- a/src/Future.php +++ b/src/Future.php @@ -86,7 +86,7 @@ final class Future } /** @var FutureState */ - private FutureState $state; + private readonly FutureState $state; /** * @param FutureState $state diff --git a/src/Internal/FutureIterator.php b/src/Internal/FutureIterator.php index 2d46d64..14996d9 100644 --- a/src/Internal/FutureIterator.php +++ b/src/Internal/FutureIterator.php @@ -18,11 +18,11 @@ final class FutureIterator /** * @var FutureIteratorQueue */ - private FutureIteratorQueue $queue; + private readonly FutureIteratorQueue $queue; - private Cancellation $cancellation; + private readonly Cancellation $cancellation; - private string $cancellationId; + private readonly string $cancellationId; /** * @var Future|Future|null diff --git a/src/Internal/WrappedCancellation.php b/src/Internal/WrappedCancellation.php index 4c5f703..f6a575e 100644 --- a/src/Internal/WrappedCancellation.php +++ b/src/Internal/WrappedCancellation.php @@ -10,7 +10,7 @@ use Amp\Cancellation; final class WrappedCancellation implements Cancellation { public function __construct( - private Cancellation $cancellation + private readonly Cancellation $cancellation ) { } diff --git a/src/TimeoutCancellation.php b/src/TimeoutCancellation.php index dbd3fa5..2eff9c0 100644 --- a/src/TimeoutCancellation.php +++ b/src/TimeoutCancellation.php @@ -9,9 +9,9 @@ use Revolt\EventLoop; */ final class TimeoutCancellation implements Cancellation { - private string $watcher; + private readonly string $watcher; - private Cancellation $cancellation; + private readonly Cancellation $cancellation; /** * @param float $timeout Seconds until cancellation is requested.