Rule to make method argument required (remove the default value) #8240
brandonkelly
started this conversation in
Ideas
Replies: 1 comment
-
I'll look into this 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be great if there was a Rector rule that removes the default value from a method argument (including subclasses), making it required.
It should also modify the type declaration for types that were made nullable thanks to the default value (this is how you could have a nullable type prior to PHP 7.1):
We could use this rule in craftcms/rector to help third party plugins clean up their code, when they’re overriding a method that used to define a default argument in the base class/interface, but doesn’t any longer.
Beta Was this translation helpful? Give feedback.
All reactions