From 1bdf01a832ff85677e2cf200cde1096a7d66179a Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Sun, 5 Feb 2023 22:25:31 -0600 Subject: [PATCH] Update for amphp/socket 2.x --- src/Rfc6455Client.php | 3 +-- test/WebsocketClientTest.php | 8 ++------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Rfc6455Client.php b/src/Rfc6455Client.php index a4dd4b9..91baa15 100644 --- a/src/Rfc6455Client.php +++ b/src/Rfc6455Client.php @@ -14,7 +14,6 @@ use Amp\Pipeline\ConcurrentIterator; use Amp\Pipeline\DisposedException; use Amp\Pipeline\Queue; -use Amp\Socket\EncryptableSocket; use Amp\Socket\Socket; use Amp\Socket\SocketAddress; use Amp\Socket\TlsInfo; @@ -109,7 +108,7 @@ public function getRemoteAddress(): SocketAddress public function getTlsInfo(): ?TlsInfo { - return $this->socket instanceof EncryptableSocket ? $this->socket->getTlsInfo() : null; + return $this->socket->getTlsInfo(); } public function getCloseCode(): int diff --git a/test/WebsocketClientTest.php b/test/WebsocketClientTest.php index 3e45afa..41f192c 100644 --- a/test/WebsocketClientTest.php +++ b/test/WebsocketClientTest.php @@ -7,7 +7,6 @@ use Amp\Future; use Amp\PHPUnit\AsyncTestCase; use Amp\Pipeline\Queue; -use Amp\Socket\EncryptableSocket; use Amp\Socket\Socket; use Amp\Socket\SocketException; use Amp\Websocket\CloseCode; @@ -22,12 +21,9 @@ class WebsocketClientTest extends AsyncTestCase { - /** - * @return Socket&MockObject - */ - protected function createSocket(): Socket + protected function createSocket(): Socket&MockObject { - return $this->createMock(EncryptableSocket::class); + return $this->createMock(Socket::class); } private function createClient(