Skip to content

Commit

Permalink
Allow strings as value for MessageEntity objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihai-amihailesei committed Sep 18, 2023
1 parent 0796007 commit ffde5dd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/M6Web/Component/Statsd/MessageEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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');
}

Expand Down

0 comments on commit ffde5dd

Please sign in to comment.