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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove |null
from union types when null is the default
#5785
Comments
can you share the reasoning behind such rule, @nicolas-grekas ? |
With union types, signatures are already very long. That CS style makes them a bit shorter without any downside. |
Did you mean -?foo $bar = null
+foo $bar = null ? |
@julienfalque yes, updated |
Ah yes, I forgot this rule has an option to make the reverse change. Closing then, thanks @kubawerlos :) |
Mmmh actually the rule does not cover the |
This PR was merged into the 4.4 branch. Discussion ---------- CS fixes | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - With a rule hinted by `@julienfalque` in PHP-CS-Fixer/PHP-CS-Fixer#5785 Commits ------- 31e1a97 CS fixes
@nicolas-grekas it took 2 years, but finally it's done 馃榿. Thank you @HypeMC for this great improvement. |
I don't remember: do we have a rule to turn an argument like
?foo $bar = null
intofoo $bat = null
, don't we?We might need one if not :)
And with union types, this rule should also turn
foo|bar|null $bar = null
intofoo|bar $bar = null
.馃檹
The text was updated successfully, but these errors were encountered: