Skip to content

feat: deprecate non-int/float values in Gauge::set()#15

Merged
kimpepper merged 2 commits into
mainfrom
feat/deprecate-gauge-mixed-value
Jul 10, 2026
Merged

feat: deprecate non-int/float values in Gauge::set()#15
kimpepper merged 2 commits into
mainfrom
feat/deprecate-gauge-mixed-value

Conversation

@kimpepper

Copy link
Copy Markdown
Member

Passing a value that is not an int or float to Gauge::set() now triggers an E_USER_DEPRECATED notice; values are still stored so behaviour is unchanged. The parameter type will be narrowed to int|float in 2.0.0.

Closes #14

Passing a value that is not an int or float to Gauge::set() now triggers
an E_USER_DEPRECATED notice. The value is still stored, so behaviour is
unchanged. The parameter type will be narrowed to int|float in the next
major release.

Also documents the encode() parameters in PrometheusEncoder so the
missing iterable value-type ignore is no longer needed.

Closes #14
@kimpepper kimpepper force-pushed the feat/deprecate-gauge-mixed-value branch from 48be809 to 91c4079 Compare July 9, 2026 23:09
@kimpepper kimpepper requested a review from acbramley July 9, 2026 23:10
Comment thread src/Gauge.php Outdated
The TriggerErrorSeeUrlFormat sniff requires drupal.org URLs, which does
not apply to this GitHub project. Exclude it globally instead of using
an inline phpcs:ignore.
@kimpepper kimpepper merged commit 08eda80 into main Jul 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce int|float value type in Gauge::set() (deprecate mixed)

2 participants