-
-
Notifications
You must be signed in to change notification settings - Fork 379
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
Fix ArgumentDefaultValueReplacer #6795
Fix ArgumentDefaultValueReplacer #6795
Conversation
@@ -6,6 +6,7 @@ class VersionCompare | |||
{ | |||
public function run() | |||
{ | |||
version_compare($a, $b, $c); |
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.
Case where previously the rule would have been applied even though no code was changed
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.
Could you extract this one a to a new "skip_*" file?
@@ -113,15 +113,17 @@ private function processArgs( | |||
$replaceArgumentDefaultValue->getValueBefore() | |||
) && $argValue === $replaceArgumentDefaultValue->getValueBefore()) { | |||
$expr->args[$position] = $this->normalizeValueToArgument($replaceArgumentDefaultValue->getValueAfter()); | |||
return $expr; |
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.
Only return an Expr if the expr is actually changed, so that the rule is not applied if no change is made
c49d752
to
f240f5d
Compare
...tor/FuncCall/FunctionArgumentDefaultValueReplacerRector/Fixture/skip_version_compare.php.inc
Outdated
Show resolved
Hide resolved
f240f5d
to
7b2626f
Compare
Thank you @carlos-granados |
Derived from #6794