Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Oct 30, 2025

refs #249

),
)->identifier('phpunit.assertEquals')
->fixNode($node, static function (CallLike $node) use ($correctName) {
if ($node instanceof Node\Expr\MethodCall) {
Copy link
Contributor Author

@staabm staabm Oct 30, 2025

Choose a reason for hiding this comment

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

since a recent change we have

if (!$node instanceof Node\Expr\MethodCall && ! $node instanceof Node\Expr\StaticCall) {
			return [];
}

at the very top of this rule, therefore we don't need to narrow here again anymore.


$args = $node->getArgs();
unset($args[0]);
$node->args = $args;
Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure you're breaking the args list contract here 😊

Copy link
Contributor Author

@staabm staabm Nov 2, 2025

Choose a reason for hiding this comment

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

good point.

what do you think about moving the new PHPParser stubs into the regular phpstan-src stubs/ directory and load them conditional via a new phpstan-src config parameter, so we can enable the more precise types in 1st party extension repos.

Copy link
Member

Choose a reason for hiding this comment

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

@staabm I'm not sure about it. I don't feel like adding a configuration option and documenting it is justified just as a temporary measure before your PR on PHP-Parser is merged.

@ondrejmirtes ondrejmirtes merged commit 36cb9a6 into phpstan:2.0.x Nov 2, 2025
70 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the fixable2 branch November 2, 2025 09:24
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.

2 participants