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
Argument removal mutators #537
Comments
What do you think, should we remove all combinations? For example $merged = array_merge($a, $b, $c); becomes $merged = array_merge($a);
$merged = array_merge($b);
$merged = array_merge($c);
$merged = array_merge($a, $b);
$merged = array_merge($a, $c);
$merged = array_merge($b, $c); ? |
These are almost duplicates to what a mutator from #514 will do. $merged = array_merge($a);
$merged = array_merge($b);
$merged = array_merge($c); E.g. the latter is same as These below look totally sensible to me:
|
Using all possible combinations of arguments not only somewhat burdensome to implement and test, but also can lead to an exponential growth of mutants to tests. Say, you have an So I think best would be not to diverge into things exponential and keep to removal of arguments, only, for time being. On a side note, I can't remember if we can add comment nodes, yet think we should be able to, but commenting out a removed argument seems prettier than just to remove: -$merged = array_merge($a, $b, $c);
+$merged = array_merge($a, /*$b,*/ $c); |
There is a lot of functions in PHP that take a variable number of arguments. They ought to be mutated. For example, like so:
And:
Obviously these have to be yield mutators, as implemented in #450, or planned to be implemented in #494. Similarly to #514 these mutators may enjoy own separate profile.
array_replace()
Enhancement: Implement ArgumentRemovalArrayReplace mutator #565array_diff()
array_merge()
The text was updated successfully, but these errors were encountered: