From ffde5dd9b0818d090692aab0efa9656e40745f4e Mon Sep 17 00:00:00 2001 From: Mihai Amihailesei Date: Mon, 18 Sep 2023 21:00:28 +0300 Subject: [PATCH] Allow strings as value for MessageEntity objects. --- src/M6Web/Component/Statsd/MessageEntity.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/M6Web/Component/Statsd/MessageEntity.php b/src/M6Web/Component/Statsd/MessageEntity.php index bc0359d..5d75029 100644 --- a/src/M6Web/Component/Statsd/MessageEntity.php +++ b/src/M6Web/Component/Statsd/MessageEntity.php @@ -25,11 +25,11 @@ class MessageEntity protected $tags = []; /** - * @param string $node node - * @param int $value value of the node - * @param string $unit units (ms for timer, c for counting ...) - * @param float $sampleRate sampling rate - * @param array $tags Tags key => value for influxDb + * @param string $node node + * @param int|string $value value of the node + * @param string $unit units (ms for timer, c for counting ...) + * @param float $sampleRate sampling rate + * @param array $tags Tags key => value for influxDb * * @return MessageEntity */ @@ -60,7 +60,7 @@ protected function checkConstructor() throw new Exception('node and unit have to be a string'); } - if (!is_int($this->value)) { + if (!is_int(intval($this->value))) { throw new Exception('value has to be an integer'); }