From 0a11cfd315827d98b968eb7cd7a75d38450be477 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 20 Jul 2015 10:28:59 -0300 Subject: [PATCH] Always ensure `value` --- src/InfluxDB/Point.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/InfluxDB/Point.php b/src/InfluxDB/Point.php index 03336eb79..12cd119c4 100644 --- a/src/InfluxDB/Point.php +++ b/src/InfluxDB/Point.php @@ -54,8 +54,10 @@ class Point } $this->measurement = (string) $measurement; - $this->tags = $tags; - $this->fields = array_merge($additionalFields, array('value' => (float) $value)); + $this->tags = $tags; + $this->fields = $additionalFields; + + $this->fields['value'] = (float) $value; if ($timestamp && !$this->isValidTimeStamp($timestamp)) { throw new DatabaseException(sprintf('%s is not a valid timestamp', $timestamp)); @@ -113,11 +115,7 @@ class Point return true; } - if ($timestamp <= PHP_INT_MAX) { - return true; - } - - if ($timestamp >= ~PHP_INT_MAX) { + if ($timestamp <= PHP_INT_MAX && $timestamp >= ~PHP_INT_MAX) { return true; }