Feature request for "remove_unneeded_parentheses".
Very important rule to allow to remove unneeded parentheses when:
throw (new Exception(('string')));
return ($v > 0) ? ($a + 1) : ($b - 1);
Let's have some features merged first (as we have 31 opened feature pull requests, when I write this message) and then add NoUselessParenthesisFixer here.
Is it now the good time? :)
Sure ;)
How about making a no_unneeded_parentheses fixer with options so that no_unneeded_control_parentheses can be deprecated and be a proxy till we remove it on 3.0 in favor of the more generic new no_unneeded_parentheses?
I would also like to see the most basic ones cleaned up, like; echo 2 + foo(( 1 )) + 1;
How about making a
no_unneeded_parenthesesfixer with options so thatno_unneeded_control_parenthesescan be deprecated and be a proxy till we remove it on 3.0 in favor of the more generic newno_unneeded_parentheses?
I agree, now we can merge as proxy and possibly replace https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/d658dc0201bdd457d32fc412d810885f282ac064/src/RuleSet.php#L109 with the new no_unneeded_parentheses with BC settings).
In 3.0, we can change the Doctrine ruleset with more stricter/breaking settings.
Most helpful comment
Let's have some features merged first (as we have 31 opened feature pull requests, when I write this message) and then add
NoUselessParenthesisFixerhere.