1
0
mirror of https://github.com/danog/amp.git synced 2024-12-04 10:28:01 +01:00

Add readonly where applicable

This commit is contained in:
Aaron Piotrowski 2022-02-24 14:26:14 -06:00
parent 082c100fc1
commit a1d9c426db
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB
6 changed files with 11 additions and 11 deletions

View File

@ -37,8 +37,8 @@ namespace Amp;
*/ */
final class DeferredCancellation final class DeferredCancellation
{ {
private Internal\Cancellable $source; private readonly Internal\Cancellable $source;
private Cancellation $cancellation; private readonly Cancellation $cancellation;
public function __construct() public function __construct()
{ {

View File

@ -8,10 +8,10 @@ namespace Amp;
final class DeferredFuture final class DeferredFuture
{ {
/** @var Internal\FutureState<T> */ /** @var Internal\FutureState<T> */
private Internal\FutureState $state; private readonly Internal\FutureState $state;
/** @var Future<T> */ /** @var Future<T> */
private Future $future; private readonly Future $future;
public function __construct() public function __construct()
{ {

View File

@ -86,7 +86,7 @@ final class Future
} }
/** @var FutureState<T> */ /** @var FutureState<T> */
private FutureState $state; private readonly FutureState $state;
/** /**
* @param FutureState<T> $state * @param FutureState<T> $state

View File

@ -18,11 +18,11 @@ final class FutureIterator
/** /**
* @var FutureIteratorQueue<Tk, Tv> * @var FutureIteratorQueue<Tk, Tv>
*/ */
private FutureIteratorQueue $queue; private readonly FutureIteratorQueue $queue;
private Cancellation $cancellation; private readonly Cancellation $cancellation;
private string $cancellationId; private readonly string $cancellationId;
/** /**
* @var Future<null>|Future<never>|null * @var Future<null>|Future<never>|null

View File

@ -10,7 +10,7 @@ use Amp\Cancellation;
final class WrappedCancellation implements Cancellation final class WrappedCancellation implements Cancellation
{ {
public function __construct( public function __construct(
private Cancellation $cancellation private readonly Cancellation $cancellation
) { ) {
} }

View File

@ -9,9 +9,9 @@ use Revolt\EventLoop;
*/ */
final class TimeoutCancellation implements Cancellation 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. * @param float $timeout Seconds until cancellation is requested.