mirror of
https://github.com/danog/amp.git
synced 2024-12-11 17:09:40 +01:00
Add readonly where applicable
This commit is contained in:
parent
082c100fc1
commit
a1d9c426db
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -86,7 +86,7 @@ final class Future
|
||||
}
|
||||
|
||||
/** @var FutureState<T> */
|
||||
private FutureState $state;
|
||||
private readonly FutureState $state;
|
||||
|
||||
/**
|
||||
* @param FutureState<T> $state
|
||||
|
@ -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
|
||||
|
@ -10,7 +10,7 @@ use Amp\Cancellation;
|
||||
final class WrappedCancellation implements Cancellation
|
||||
{
|
||||
public function __construct(
|
||||
private Cancellation $cancellation
|
||||
private readonly Cancellation $cancellation
|
||||
) {
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user