From f9eb3a906428f32ffaf2aec7606fcb491a79b69d Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Tue, 3 Aug 2021 09:25:32 -0500 Subject: [PATCH 1/2] Allow use of guzzlehttp/psr7:^2.0 --- composer.json | 1 + src/Connector.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 331fc49..fb2939d 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,7 @@ , "require": { "php": ">=5.4" , "evenement/evenement": "^3.0 || ^2.0" + , "guzzlehttp/psr7": "^2.0 || ^1.7" , "ratchet/rfc6455": "^0.3" , "react/socket": "^1.9" } diff --git a/src/Connector.php b/src/Connector.php index b407d2f..0327469 100644 --- a/src/Connector.php +++ b/src/Connector.php @@ -85,10 +85,10 @@ public function __invoke($url, array $subProtocols = [], array $headers = []) { $stream->removeListener('data', $headerParser); - $response = gPsr\parse_response($buffer); + $response = gPsr\Message::parseResponse($buffer); if (!$this->_negotiator->validateResponse($request, $response)) { - $futureWsConn->reject(new \DomainException(gPsr\str($response))); + $futureWsConn->reject(new \DomainException(gPsr\Message::toString($response))); $stream->close(); return; @@ -110,7 +110,7 @@ public function __invoke($url, array $subProtocols = [], array $headers = []) { }; $stream->on('data', $headerParser); - $stream->write(gPsr\str($request)); + $stream->write(gPsr\Message::toString($request)); }, array($futureWsConn, 'reject')); return $futureWsConn->promise(); @@ -124,7 +124,7 @@ public function __invoke($url, array $subProtocols = [], array $headers = []) { * @return \Psr\Http\Message\RequestInterface */ protected function generateRequest($url, array $subProtocols, array $headers) { - $uri = gPsr\uri_for($url); + $uri = gPsr\Utils::uriFor($url); $scheme = $uri->getScheme(); From 42e299c1658c7b3c9176562574501c869d3bafe1 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Thu, 9 Dec 2021 19:26:54 -0600 Subject: [PATCH 2/2] Update composer.json Co-authored-by: Chris Boden --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fb2939d..d7a09ec 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "php": ">=5.4" , "evenement/evenement": "^3.0 || ^2.0" , "guzzlehttp/psr7": "^2.0 || ^1.7" - , "ratchet/rfc6455": "^0.3" + , "ratchet/rfc6455": "^0.3.1" , "react/socket": "^1.9" } , "require-dev": {