- 
                Notifications
    
You must be signed in to change notification settings  - Fork 50
 
Make AssertSameBooleanExpectedRule auto-fixable #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
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; | 
There was a problem hiding this comment.
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 😊
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| 
           Thank you!  | 
    
refs #249