diff --git a/src/Nats/Connection.php b/src/Nats/Connection.php index 2937a86..81552d8 100644 --- a/src/Nats/Connection.php +++ b/src/Nats/Connection.php @@ -445,7 +445,10 @@ public function connect($timeout = null) $this->timeout = $timeout; $this->streamSocket = $this->getStream( - $this->options->getAddress(), $timeout, $this->options->getStreamContext()); + $this->options->getAddress(), + $timeout, + $this->options->getStreamContext() + ); $this->setStreamTimeout($timeout); $infoResponse = $this->receive(); @@ -459,10 +462,14 @@ public function connect($timeout = null) function ($errno, $errstr, $errfile, $errline) { restore_error_handler(); throw Exception::forFailedConnection($errstr); - }); + } + ); if (!stream_socket_enable_crypto( - $this->streamSocket, true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT)) { + $this->streamSocket, + true, + STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT + )) { throw Exception::forFailedConnection('Error negotiating crypto'); }