Skip to content

Skip first-class callable in CommandConfigureToAttributeRector - #1104

Merged
TomasVotruba merged 2 commits into
mainfrom
skip-first-class-callable-command-configure
Nov 14, 2026
Merged

TomasVotruba merged 2 commits into
mainfrom
skip-first-class-callable-command-configure

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Follow-up to #1102.

findAndRemoveMethodExpr() called getArgs()[0] on matching method calls without checking for first-class callables. A configure() like this crashed the rule:

protected function configure(): void
{
    $setDescription = $this->setDescription(...);
    $setDescription('Some description');
}
TypeError: isPermittedAttributeValue(): Argument #1 ($expr) must be of type PhpParser\Node\Expr, null given

Now the first-class callable is skipped, same as in hasPermittedMethodCall(). Covered by skip_first_class_callable fixture.

@TomasVotruba
TomasVotruba merged commit bf9c193 into main Nov 14, 2026
8 checks passed
@TomasVotruba
TomasVotruba deleted the skip-first-class-callable-command-configure branch November 14, 2026 12:57
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.

2 participants