Skip to content

fix: declare the statuses() error key as nullable and make psalm pass - #24

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

roxblnfk merged 1 commit into
2.xfrom
static-analysis

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Oct 9, 2026

Copy link
Copy Markdown
Member

What was changed

  • Manager::statuses() docblock now declares error as an always present null|array{...} key, matching what the method has always returned ('error' => null for a process without an error) instead of an optional key.
  • ClassMustBeFinal is suppressed in psalm.xml: Exception\ServiceException stays extendable, so there is no BC break.
  • A redundant assert() and an inline suppression in statuses() are gone; the psalm workflow runs on pushes to 2.x ('*.*' before) and psalm.xml is excluded from the dist archive.
  • No #[\Override] was needed: no method in src overrides or implements a parent one.

Why?

Psalm 6 is red on 2.x with ClassMustBeFinal and RedundantConditionGivenDocblockType; with this PR it reports no errors.

Checklist

  • Tested
    • vendor/bin/psalm (6.20) locally without ext-protobuf, PHP versions 8.2 and 8.3: no errors

refactor: drop the redundant Status assertion in Manager::statuses()
ci: run psalm on pushes to 2.x

statuses() has always returned 'error' => null for a process without an error, while the docblock declared an optional key. ClassMustBeFinal is suppressed instead of making Exception\ServiceException final, which would break users extending it.

Assisted-By: Claude Opus 5.5
@roxblnfk
roxblnfk requested a review from a team October 9, 2026 20:30
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Important

  • 馃攳 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

鈿欙笍 Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 068ff717-7aa3-4b18-9741-e090daa5cef8

  • 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 6d866a3 into 2.x Oct 9, 2026
10 checks passed
@roxblnfk
roxblnfk deleted the static-analysis branch October 9, 2026 20:31
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