Skip to content

ref(metrics): Drop redundant @var on MetricsAggregator metric to drop PHPStan baseline entry - #2365

Merged
stayallive merged 1 commit into
masterfrom
junior/phpstan-metrics-aggregator-var-tag
Nov 16, 2026
Merged

stayallive merged 1 commit into
masterfrom
junior/phpstan-metrics-aggregator-var-tag

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Removes this entry from phpstan-baseline.neon:

PHPDoc tag @var with type Sentry\Metrics\Types\Metric is not subtype of native type CounterMetric|DistributionMetric|GaugeMetric. (varTag.nativeType, src/Metrics/MetricsAggregator.php)

MetricsAggregator::add() had a /** @var Metric $metric */ over new $metricTypeClass(...). PHPStan already infers the narrower CounterMetric|DistributionMetric|GaugeMetric union from the METRIC_TYPES map, so the tag only widened the type. This PR deletes the tag.

Only a docblock changes, so runtime behavior stays the same.

via automation sched_a59acc45df166a80a839d0b32321e740 · Run ID sched_a59acc45df166a80a839d0b32321e740:1794819600000.

--

View Session [Sentry]

@stayallive
stayallive marked this pull request as ready for review November 16, 2026 09:43
@stayallive
stayallive requested a review from a team as a code owner November 16, 2026 09:43
@stayallive
stayallive merged commit fcb0ec4 into master Nov 16, 2026
58 checks passed
@stayallive
stayallive deleted the junior/phpstan-metrics-aggregator-var-tag branch November 16, 2026 09:45
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.

1 participant