@@ -95,7 +95,7 @@ public function getMetricFamilySamples(bool $sortMetrics = true): array
9595 * @return Gauge
9696 * @throws MetricsRegistrationException
9797 */
98- public function registerGauge (string $ namespace , string $ name , string $ help , $ labels = []): Gauge
98+ public function registerGauge (string $ namespace , string $ name , string $ help , array $ labels = []): Gauge
9999 {
100100 $ metricIdentifier = self ::metricIdentifier ($ namespace , $ name );
101101 if (isset ($ this ->gauges [$ metricIdentifier ])) {
@@ -136,7 +136,7 @@ public function getGauge(string $namespace, string $name): Gauge
136136 * @return Gauge
137137 * @throws MetricsRegistrationException
138138 */
139- public function getOrRegisterGauge (string $ namespace , string $ name , string $ help , $ labels = []): Gauge
139+ public function getOrRegisterGauge (string $ namespace , string $ name , string $ help , array $ labels = []): Gauge
140140 {
141141 try {
142142 $ gauge = $ this ->getGauge ($ namespace , $ name );
@@ -155,7 +155,7 @@ public function getOrRegisterGauge(string $namespace, string $name, string $help
155155 * @return Counter
156156 * @throws MetricsRegistrationException
157157 */
158- public function registerCounter (string $ namespace , string $ name , string $ help , $ labels = []): Counter
158+ public function registerCounter (string $ namespace , string $ name , string $ help , array $ labels = []): Counter
159159 {
160160 $ metricIdentifier = self ::metricIdentifier ($ namespace , $ name );
161161 if (isset ($ this ->counters [$ metricIdentifier ])) {
@@ -196,7 +196,7 @@ public function getCounter(string $namespace, string $name): Counter
196196 * @return Counter
197197 * @throws MetricsRegistrationException
198198 */
199- public function getOrRegisterCounter (string $ namespace , string $ name , string $ help , $ labels = []): Counter
199+ public function getOrRegisterCounter (string $ namespace , string $ name , string $ help , array $ labels = []): Counter
200200 {
201201 try {
202202 $ counter = $ this ->getCounter ($ namespace , $ name );
@@ -211,7 +211,7 @@ public function getOrRegisterCounter(string $namespace, string $name, string $he
211211 * @param string $name e.g. duration_seconds
212212 * @param string $help e.g. A histogram of the duration in seconds.
213213 * @param string[] $labels e.g. ['controller', 'action']
214- * @param mixed []|null $buckets e.g. [100, 200, 300]
214+ * @param float []|null $buckets e.g. [100.0 , 200.0 , 300.0 ]
215215 *
216216 * @return Histogram
217217 * @throws MetricsRegistrationException
@@ -221,7 +221,7 @@ public function registerHistogram(
221221 string $ name ,
222222 string $ help ,
223223 array $ labels = [],
224- array $ buckets = null
224+ ? array $ buckets = null
225225 ): Histogram {
226226 $ metricIdentifier = self ::metricIdentifier ($ namespace , $ name );
227227 if (isset ($ this ->histograms [$ metricIdentifier ])) {
@@ -259,7 +259,7 @@ public function getHistogram(string $namespace, string $name): Histogram
259259 * @param string $name e.g. duration_seconds
260260 * @param string $help e.g. A histogram of the duration in seconds.
261261 * @param string[] $labels e.g. ['controller', 'action']
262- * @param float[]|null $buckets e.g. [100, 200, 300]
262+ * @param float[]|null $buckets e.g. [100.0 , 200.0 , 300.0 ]
263263 *
264264 * @return Histogram
265265 * @throws MetricsRegistrationException
@@ -269,7 +269,7 @@ public function getOrRegisterHistogram(
269269 string $ name ,
270270 string $ help ,
271271 array $ labels = [],
272- array $ buckets = null
272+ ? array $ buckets = null
273273 ): Histogram {
274274 try {
275275 $ histogram = $ this ->getHistogram ($ namespace , $ name );
@@ -297,7 +297,7 @@ public function registerSummary(
297297 string $ help ,
298298 array $ labels = [],
299299 int $ maxAgeSeconds = 600 ,
300- array $ quantiles = null
300+ ? array $ quantiles = null
301301 ): Summary {
302302 $ metricIdentifier = self ::metricIdentifier ($ namespace , $ name );
303303 if (isset ($ this ->summaries [$ metricIdentifier ])) {
@@ -348,7 +348,7 @@ public function getOrRegisterSummary(
348348 string $ help ,
349349 array $ labels = [],
350350 int $ maxAgeSeconds = 600 ,
351- array $ quantiles = null
351+ ? array $ quantiles = null
352352 ): Summary {
353353 try {
354354 $ summary = $ this ->getSummary ($ namespace , $ name );
0 commit comments