Skip to content

Commit

Permalink
Deprecation for #24
Browse files Browse the repository at this point in the history
Marked WebsocketCompressionContextFactory argument as deprecated and unused.
  • Loading branch information
trowski committed Oct 21, 2023
1 parent ec8a6f5 commit 904902c
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/Rfc6455ClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ final class Rfc6455ClientFactory implements WebsocketClientFactory
use ForbidSerialization;

/**
* @param WebsocketCompressionContextFactory|null $compressionContextFactory Use null to disable compression.
* @param WebsocketCompressionContextFactory|null $compressionContextFactory Deprecated. This argument is unused.
* Compression is not supported in v3.x but will be in v4.x.
* @param WebsocketHeartbeatQueue|null $heartbeatQueue Use null to disable automatic heartbeats (pings).
* @param WebsocketRateLimit|null $rateLimit Use null to disable client rate limits.
*/
Expand Down Expand Up @@ -64,24 +65,10 @@ public function createClient(
}
}

$compressionContext = null;
if ($this->compressionContextFactory) {
$extensions = \array_map('trim', \explode(',', (string) $request->getHeader('sec-websocket-extensions')));

foreach ($extensions as $extension) {
if ($compressionContext = $this->compressionContextFactory->fromClientHeader($extension, $headerLine)) {
/** @psalm-suppress PossiblyNullArgument */
$response->setHeader('sec-websocket-extensions', $headerLine);
break;
}
}
}

return new Rfc6455Client(
socket: $socket,
masked: false,
parserFactory: $this->parserFactory,
compressionContext: $compressionContext,
heartbeatQueue: $this->heartbeatQueue,
rateLimit: $this->rateLimit,
frameSplitThreshold: $this->frameSplitThreshold,
Expand Down

0 comments on commit 904902c

Please sign in to comment.