Skip to content

Remove callable.nonNativeMethod - #5004

Merged
ondrejmirtes merged 2 commits into
phpstan:2.1.xfrom
VincentLanglet:fixx/13596
Feb 19, 2026
Merged

ondrejmirtes merged 2 commits into
phpstan:2.1.xfrom
VincentLanglet:fixx/13596

Conversation

@VincentLanglet

@VincentLanglet VincentLanglet commented Feb 19, 2026 •

Copy link
Copy Markdown
Contributor

->build();

return $errors;
return $this->methodCallCheck->check($scope, $methodNameName, $node->getVar(), $node->getName())[0];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the returning of the array shape with the method reflection might have been introduced exactly because of this. It might be possible to simplify the return type and let it just returns errors instead of the tuple.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked and the shape seems to always have existed, and the methodReflection is used somewhere else

private function processSingleMethodCall(Scope $scope, MethodCall $node, string $methodName): array

@VincentLanglet
VincentLanglet marked this pull request as ready for review February 19, 2026 22:37
@phpstan-bot

Copy link
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes
ondrejmirtes merged commit 56c1e37 into phpstan:2.1.x Feb 19, 2026
645 of 652 checks passed
@ondrejmirtes

Copy link
Copy Markdown
Member

Thank you!

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.

4 participants