1
0
mirror of https://github.com/danog/amp.git synced 2024-12-03 09:57:51 +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
{
private Internal\Cancellable $source;
private Cancellation $cancellation;
private readonly Internal\Cancellable $source;
private readonly Cancellation $cancellation;
public function __construct()
{

View File

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

View File

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

View File

@ -18,11 +18,11 @@ final class FutureIterator
/**
* @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

View File

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

View File

@ -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.