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(