Skip to content

Commit

Permalink
Allow use of guzzlehttp/psr7:^2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mbabker committed Nov 7, 2021
1 parent 31769d2 commit f9eb3a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
8 changes: 4 additions & 4 deletions src/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand All @@ -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();

Expand Down

0 comments on commit f9eb3a9

Please sign in to comment.