Skip to content

refactor: add #[\Override], make psalm pass without ext-msgpack - #41

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

roxblnfk merged 1 commit into
4.xfrom
static-analysis

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Oct 9, 2026

Copy link
Copy Markdown
Member

🔍 What was changed

  • Every method that overrides or implements a parent/interface method in src/ carries #[\Override], except MsgpackCodec, which is left untouched until the msgpack deprecation is decided. On PHP 8.2 the attribute is inert, no polyfill added.
  • Psalm now loads the existing resources/stubs/msgpack.phpstub, so it passes without ext-msgpack installed (before, it reported UndefinedFunction for msgpack_pack/msgpack_unpack locally).
  • The baseline shrinks to the MsgpackCodec closure-type entries only: Frame::initFrame() now handles a false from unpack(), and the port/stream checks in SocketRelay and StreamRelay carry inline @psalm-suppress DocblockTypeContradiction — they are runtime guards for callers without static analysis, so removing them would be a behaviour change.
  • No public API changes: no classes made final, no signatures changed (ClassMustBeFinal stays disabled in psalm.xml).

Stacked on #40.

Checklist

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • 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.

Base automatically changed from testo to 4.x October 9, 2026 16:10
chore(psalm): load the msgpack stub and shrink the baseline

`MsgpackCodec` is left as is pending the msgpack deprecation decision, so its remaining issues stay in the baseline. The relay port and stream checks are runtime guards for callers without static analysis, hence the inline suppressions.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk
roxblnfk merged commit 6c1bf4d into 4.x Oct 9, 2026
11 checks passed
@roxblnfk
roxblnfk deleted the static-analysis branch October 9, 2026 16:12
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