diff --git a/src/Driver/Internal/Http2Stream.php b/src/Driver/Internal/Http2Stream.php index 4d915806..151170d2 100644 --- a/src/Driver/Internal/Http2Stream.php +++ b/src/Driver/Internal/Http2Stream.php @@ -18,24 +18,15 @@ final class Http2Stream public const REMOTE_CLOSED = 0b0010; public const LOCAL_CLOSED = 0b0100; - /** @var int Current body size limit. */ - public int $bodySizeLimit; - /** @var int Bytes received on the stream. */ public int $receivedByteCount = 0; - public int $serverWindow; - - public int $clientWindow; - public ?Future $pendingResponse = null; public ?Future $pendingWrite = null; public string $buffer = ""; - public int $state; - public ?DeferredFuture $deferredFuture = null; /** @var int Integer between 1 and 256 */ @@ -47,13 +38,12 @@ final class Http2Stream public readonly DeferredCancellation $deferredCancellation; - public function __construct(int $bodySizeLimit, int $serverSize, int $clientSize, int $state = self::OPEN) - { - $this->bodySizeLimit = $bodySizeLimit; - $this->serverWindow = $serverSize; - $this->clientWindow = $clientSize; - $this->state = $state; - + public function __construct( + public int $bodySizeLimit, + public int $serverWindow, + public int $clientWindow, + public int $state = self::OPEN, + ) { $this->deferredCancellation = new DeferredCancellation(); } } diff --git a/src/Push.php b/src/Push.php index 2f56bd9d..1c2d0e5a 100644 --- a/src/Push.php +++ b/src/Push.php @@ -8,18 +8,15 @@ final class Push extends HttpMessage { - private readonly PsrUri $uri; - /** * @param array> $headers * * @throws InvalidHeaderException If given headers contain and invalid header name or value. * @throws \Error If the given headers have a colon-prefixed header or a Host header. */ - public function __construct(PsrUri $uri, array $headers = []) + public function __construct(private readonly PsrUri $uri, array $headers = []) { $this->setHeaders($headers); - $this->uri = $uri; } protected function setHeader(string $name, array|string $value): void