Repository navigation
Fix assertions on $this of calls with no object, and make call-site InvalidDocblock suppressible - #14678
Conversation
…nvalidDocblock suppressible An assertion on `$this` or `$this->prop` is only translated to the object for `$obj->method()`. For `new`, functions, static calls and calls on an object with no id it fell back to the caller's `$this`, or was reported as InvalidDocblock. `parent::`/`self::` calls now assert on `$this`, and the conditional assertions of a `self::` call forwarded to `$this` are kept. InvalidDocblock reported at a call for the called function's assertions, and for malformed inline docblocks, now honours `@psalm-suppress`. Fixes vimeo#11662 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit dfcc361. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfcc36104c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
✅ Performance: unchanged · Types: unchanged
How to read this table
head 74106cf · base 40f73cb (merge-base) · workflow run |
… static targets An instance method called statically asserts on `$this` only when it is a method of the caller's class or of an ancestor. A static call on several possible classes keeps only the conditional assertions they all make. MissingDocblockType in malformed inline docblocks honours @psalm-suppress like InvalidDocblock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assertions on
$thisof a call with no objectAn assertion on
$thisor$this->propof a constructor, of a static method or of a call on an object with no id is reported asInvalidDocblock, or applied to the caller's own$this.Before
After
Assertions on
$thisofparent::andself::callsBefore
After
Static call on one of several classes
A static call on a union of classes takes the conditional assertions of one of them, even when another makes none.
Before
After
@psalm-suppress InvalidDocblockignoredAn
InvalidDocblockreported at a call for the assertions of the called function, or for a malformed inline@var, can't be suppressed.Before
After
Fixes #11662
🤖 Generated with Claude Code