diff --git a/src/Metric.php b/src/Metric.php index 2468948..3614637 100644 --- a/src/Metric.php +++ b/src/Metric.php @@ -22,7 +22,7 @@ abstract class Metric { /** * The help message for the metric. * - * @var string + * @var string|\Stringable */ protected $help; @@ -40,10 +40,10 @@ abstract class Metric { * The metric namespace. * @param string $name * The metric name. - * @param string $help + * @param string|\Stringable $help * The help message for the metric. */ - public function __construct(string $namespace, string $name, string $help) { + public function __construct(string $namespace, string $name, string|\Stringable $help) { $fullName = $namespace . '_' . $name; $this->validateName($fullName); $this->name = $fullName; @@ -71,10 +71,10 @@ public function getName(): string { /** * Gets the Help. * - * @return string + * @return string|\Stringable * The Help. */ - public function getHelp(): string { + public function getHelp(): string|\Stringable { return $this->help; } diff --git a/src/Summary.php b/src/Summary.php index 3d3e2c7..d417878 100644 --- a/src/Summary.php +++ b/src/Summary.php @@ -36,7 +36,7 @@ class Summary extends Metric { /** * Summary constructor. */ - public function __construct(string $namespace, string $name, string $help, $label) { + public function __construct(string $namespace, string $name, string|\Stringable $help, $label) { parent::__construct($namespace, $name, $help); $this->sum = 0; $this->count = 0;