-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add a rule to force-add or force-remove ?
on nullable types
#3883
Comments
Hi, |
note that so, I would even say (as often, |
@keradus I think for this case the NoUnreachableDefaultArgumentValueFixer should be updated.
|
…for nullable typehints (gharlan, keradus) This PR was squashed before being merged into the 2.13-dev branch (closes #3914). Discussion ---------- NoUnreachableDefaultArgumentValueFixer - remove `null` for nullable typehints #3883 (comment) Commits ------- dad732f NoUnreachableDefaultArgumentValueFixer - remove `null` for nullable typehints
Closing due to merge of #4401 |
Sorry if this already exists, I didn't find it with a quick lookup,
Since PHP 7.1, nullable arguments can be written with or without the
?
prefix:Form 1:
function (string $s = null) {}
vs
Form 2:
function (?string $s = null) {}
It would be great to have a rule to normalize to either form 1 or 2.
(On Symfony, we would stick to Form 1 for consistency with branches that still support PHP 5.5)
The text was updated successfully, but these errors were encountered: