Skip to content

refactor: mark overriding methods with #[\Override] - #52

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

  • Methods that implement or override a parent method carry #[\Override], and Psalm now reports MissingOverrideAttribute instead of suppressing it. PHP 8.2 ignores the attribute, so no polyfill is needed.
  • ClassMustBeFinal stays suppressed: making Worker, Environment or Logger final would break code that extends them.
  • Dropped a @psalm-suppress on Logger::log() that no longer matched any issue. The one on the (string) cast in Environment::get() stays, because fromGlobals() passes $_SERVER, which holds non-string values despite the declared type.

Checklist

  • How was this tested:
    • Psalm 6.20 at error level 1 reports no errors locally
    • All 88 Testo tests pass locally, the same count as on 3.x

Psalm now checks `MissingOverrideAttribute` instead of suppressing it. The attribute is harmless on PHP 8.2, which does not validate it. `ClassMustBeFinal` stays suppressed because making public classes final would break BC. The `@psalm-suppress` on `Logger::log()` matched no issue and is dropped.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk
roxblnfk requested a review from a team October 9, 2026 18:59
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6e58b5ab-0394-4e35-8b9b-6d061e3e9239

📥 Commits

Reviewing files that changed from the base of the PR and between eeec76c and be39954.


📒 Files selected for processing (6)
  • psalm.xml
  • src/Environment.php
  • src/Informer/Workers.php
  • src/Logger.php
  • src/Worker.php
  • tests/Unit/Stub/TestRelay.php


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@roxblnfk
roxblnfk merged commit 11fd2a0 into 3.x Oct 9, 2026
15 checks passed
@roxblnfk
roxblnfk deleted the static-analysis branch October 9, 2026 19:16
This was referenced 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