Skip to content

Skip first-class callable in ResponseStatusCodeRector - #1103

Merged
TomasVotruba merged 1 commit into
mainfrom
fix-response-status-fcc
Nov 3, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
fix-response-status-fcc

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Fixes rectorphp/rector#9954

ResponseStatusCodeRector crashed when it visited a first-class callable whose method name starts with assert, e.g. $validator->assert(...) (common with validation libraries like PSL). processAssertMethodCall() called getArgs() on a first-class callable, which trips the php-parser assertion:

assert(!$this->isPartialFunctionApplication())

A first-class callable has no arguments to inspect, so this adds an early guard in processMethodCall() to skip it. New skip fixture reproduces the crash without the guard (confirmed failing before the fix).

@TomasVotruba
TomasVotruba merged commit ebdffc2 into main Nov 3, 2026
8 checks passed
@TomasVotruba
TomasVotruba deleted the fix-response-status-fcc branch November 3, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

ResponseStatusCodeRector crashes on first-class callable of a method named assert*

1 participant