From f75f1b403f235ee15e257fe49e61f5dbfe6424f4 Mon Sep 17 00:00:00 2001 From: Mike Row <47996463+mikerow@users.noreply.github.com> Date: Sun, 28 Jun 2020 22:23:21 +0200 Subject: [PATCH] Update NanoIPC.php --- src/NanoIPC.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/NanoIPC.php b/src/NanoIPC.php index d08c287..ec0e5ed 100644 --- a/src/NanoIPC.php +++ b/src/NanoIPC.php @@ -13,7 +13,7 @@ class NanoIPC private $transportType; private $transport; private $transportPreamble; - private $transportPath; + private $transportPathToSocket; private $transportHostname; private $transportPort; private $authType; @@ -39,13 +39,13 @@ public function __construct(string $transport_type, array $params) // # Unix domain Socket if ($transport_type == 'unix_domain_socket') { - if (!isset($params['path']) || !is_string($params['path'])) { - throw new NanoIPCException("Invalid transport path: " . $params['path']); + if (!isset($params['path_to_socket']) || !is_string($params['path_to_socket'])) { + throw new NanoIPCException("Invalid path to socket: " . $params['path_to_socket']); } - $this->transportPath = $params['path']; + $this->transportPathToSocket = $params['path_to_socket']; $this->transport = stream_socket_client( - "unix://{$this->transportPath}", + "unix://{$this->transportPathToSocket}", $this->errorCode, $this->error ); @@ -58,10 +58,10 @@ public function __construct(string $transport_type, array $params) } elseif ($transport_type == 'TCP') { if (!isset($params['hostname']) || !is_string($params['hostname'])) { - throw new NanoIPCException("Invalid transport hostname: " . $params['hostname']); + throw new NanoIPCException("Invalid hostname: " . $params['hostname']); } if (!isset($params['port']) || !is_int((int) $params['port'])) { - throw new NanoIPCException("Invalid transport port: " . $params['port']); + throw new NanoIPCException("Invalid port: " . $params['port']); } $this->transportHostname = $params['hostname'];