Suppress Psalm UndefinedDocblockClass for Internal\RepeatedField#1959
Draft
bobstrecansky wants to merge 1 commit into
Draft
Suppress Psalm UndefinedDocblockClass for Internal\RepeatedField#1959bobstrecansky wants to merge 1 commit into
bobstrecansky wants to merge 1 commit into
Conversation
google/protobuf 4.x deprecated Google\Protobuf\Internal\RepeatedField in favor of Google\Protobuf\RepeatedField. The Internal class is now a stub guarded by `if (false)` with a runtime class_alias, so Psalm's static analysis sees it as undefined. The generated proto messages still reference it in their getter return-type docblocks, which surfaces as UndefinedDocblockClass across the Otlp converters. Suppress the issue for that single referenced class, matching the existing pattern used for offsetGet/offsetSet on the same class.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1959 +/- ##
============================================
- Coverage 67.75% 67.71% -0.05%
Complexity 3044 3044
============================================
Files 459 459
Lines 8883 8883
============================================
- Hits 6019 6015 -4
- Misses 2864 2868 +4
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UndefinedDocblockClassissues that referenceGoogle\Protobuf\Internal\RepeatedField.Why
google/protobuf 4.x deprecated
Google\Protobuf\Internal\RepeatedFieldinfavor of
Google\Protobuf\RepeatedField. The Internal class is now definedas an
if (false) { class RepeatedField extends \Google\Protobuf\RepeatedField {} }stub plus a runtimeclass_alias.Psalm's static parser can see only the stub, not the alias, so getters on the
generated proto messages that return
Internal\RepeatedField(e.g.ExportMetricsServiceRequest::getResourceMetrics()) triggerUndefinedDocblockClasson every Otlp converter file.This is the same workaround pattern already used for
offsetGet/offsetSeton the same class. No source changes; once
google/protobufremoves theInternal stub entirely we can revisit.
Unblocks PHP QA on PHP 8.2/8.3/8.4 main builds.
Test plan