diff --git a/src/M6Web/Component/Statsd/MessageEntity.php b/src/M6Web/Component/Statsd/MessageEntity.php index 5d75029..77e7f81 100644 --- a/src/M6Web/Component/Statsd/MessageEntity.php +++ b/src/M6Web/Component/Statsd/MessageEntity.php @@ -60,8 +60,8 @@ protected function checkConstructor() throw new Exception('node and unit have to be a string'); } - if (!is_int(intval($this->value))) { - throw new Exception('value has to be an integer'); + if (!is_int($this->value) || !is_string($this->value)) { + throw new Exception('value has to be an integer or a string'); } if (!is_float($this->sampleRate) or ($this->sampleRate <= 0)) {