Skip to content

refactor: enforce #[\Override] and drop unused psalm suppressions - #50

Merged
roxblnfk merged 1 commit into
3.xfrom
static-analysis
Oct 9, 2026
Merged

roxblnfk merged 1 commit into
3.xfrom
static-analysis

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Oct 9, 2026

Copy link
Copy Markdown
Member

🔍 What was changed

  • Psalm now requires #[\Override] on methods that implement or override a parent one (ensureOverrideAttribute); src already carried it, the test stub service gets it too. PHP 8.2 ignores the attribute, so no polyfill is needed.
  • Dropped four @psalm-suppress annotations and the MixedReturnStatement, UnusedPsalmSuppress, InvalidAttribute and UndefinedAttributeClass handlers that no longer matched any issue.
  • Still suppressed, with a comment in psalm.xml: RedundantConditionGivenDocblockType and DocblockTypeContradiction for the runtime guards in Context offsets and the service interface NAME, and MissingClassConstType, because typed class constants need PHP 8.3.

Checklist

  • How was this tested:
    • Psalm 6.20 at error level 1 reports no errors locally with --php-version 8.2, 8.3 and 8.4 (without ext-protobuf, as in CI)
    • All 68 Testo tests pass locally, the same count as on 3.x

The remaining suppressions cover runtime guards against callers that ignore docblock types, and untyped class constants, which need PHP 8.3.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk
roxblnfk requested a review from a team October 9, 2026 20:15
@roxblnfk
roxblnfk merged commit 2c454f5 into 3.x Oct 9, 2026
9 checks passed
@roxblnfk
roxblnfk deleted the static-analysis branch October 9, 2026 20:19
@github-actions github-actions Bot mentioned this pull request Oct 9, 2026
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