From 4c898dc53189f7fb5acc5aa4efb22865958bc07b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20K=C3=A4mmerling?= Date: Fri, 2 Oct 2020 18:12:39 +0200 Subject: [PATCH] Always cast redis port and timeout to the correct value types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lukas Kämmerling --- src/Prometheus/Storage/Redis.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Prometheus/Storage/Redis.php b/src/Prometheus/Storage/Redis.php index 6e59574a..5627612a 100644 --- a/src/Prometheus/Storage/Redis.php +++ b/src/Prometheus/Storage/Redis.php @@ -150,11 +150,11 @@ private function connectToServer(): void if ($this->options['persistent_connections']) { $connection_successful = $this->redis->pconnect( $this->options['host'], - $this->options['port'], - $this->options['timeout'] + (int) $this->options['port'], + (float) $this->options['timeout'] ); } else { - $connection_successful = $this->redis->connect($this->options['host'], $this->options['port'], $this->options['timeout']); + $connection_successful = $this->redis->connect($this->options['host'], (int) $this->options['port'], (float) $this->options['timeout']); } if (!$connection_successful) { throw new StorageException("Can't connect to Redis server", 0);