From 862afae3f3cff1370619a7dc2ba6b1b907f6368e Mon Sep 17 00:00:00 2001 From: Andrew Cornforth Date: Mon, 15 Jul 2024 13:29:45 +0100 Subject: [PATCH] fix buggy inverse logic detecting iterable options --- src/Nats/ConnectionOptions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Nats/ConnectionOptions.php b/src/Nats/ConnectionOptions.php index a140e63..428cd33 100644 --- a/src/Nats/ConnectionOptions.php +++ b/src/Nats/ConnectionOptions.php @@ -124,7 +124,7 @@ public function __construct($options = null) */ public function getAddress() { - return 'tcp://'.$this->host.':'.$this->port; + return 'tcp://' . $this->host . ':' . $this->port; } /** @@ -135,7 +135,7 @@ public function getAddress() public function __toString() { $a = [ - 'lang'=> $this->lang, + 'lang' => $this->lang, 'version' => $this->version, 'verbose' => $this->verbose, 'pedantic' => $this->pedantic, @@ -434,7 +434,7 @@ public function setConnectionOptions($options) */ protected function initialize($options) { - if (is_iterable($options)) { + if (!is_iterable($options)) { throw new Exception('The $options argument must be iterable!'); } foreach ($options as $key => $value) {