Make AssertSameBooleanExpectedRule auto-fixable#252
Make AssertSameBooleanExpectedRule auto-fixable#252ondrejmirtes merged 2 commits intophpstan:2.0.xfrom
Conversation
| ), | ||
| )->identifier('phpunit.assertEquals') | ||
| ->fixNode($node, static function (CallLike $node) use ($correctName) { | ||
| if ($node instanceof Node\Expr\MethodCall) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Pretty sure you're breaking the args list contract here 😊
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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.
|
Thank you! |
refs #249