diff --git a/src/Prometheus/Histogram.php b/src/Prometheus/Histogram.php index 9dbfda4..9041a3a 100644 --- a/src/Prometheus/Histogram.php +++ b/src/Prometheus/Histogram.php @@ -39,10 +39,8 @@ public function __construct(Adapter $adapter, $namespace, $name, $help, $labels ); } } - foreach ($labels as $label) { - if ($label === 'le') { - throw new \InvalidArgumentException("Histogram cannot have a label named 'le'."); - } + if (in_array('le', $labels, true)) { + throw new \InvalidArgumentException("Histogram cannot have a label named 'le'."); } $this->buckets = $buckets; }