PromPHP / prometheus_client_php

Prometheus instrumentation library for PHP applications
https://prometheus.io/docs/concepts/metric_types/
Apache License 2.0
415 stars 91 forks source link

BC on RegistryInterface in getMetricFamilySamples() method from 2.7.0 #117

Closed javespi closed 1 year ago

javespi commented 1 year ago

Hello,

I have a custom implementation for Prometheus\RegistryInterface class which since 2.7.0 requires me to implement the method getMetricFamilySamples() with an argument:

PHP Fatal error:  Declaration of Javespi\MyCollectorRegistry::getMetricFamilySamples(): array
must be compatible with Prometheus\RegistryInterface::getMetricFamilySamples(bool $sortMetrics = true): array

It looks like the BC was introduced in this PR:

I am going to try to create a pull-request to solve it without losing the new feature.

Cheers

LKaemmerling commented 1 year ago

Hey @javespi,

thank you for the headsup. I just released a new version (2.7.1) with your changes.