-
Notifications
You must be signed in to change notification settings - Fork 696
Closed
Labels
Description
When I have a method which declares a callback to consume 2 arguments but my defined callback does not care about the first argument, psalm is issuing UnusedClosureParam even tho, its not like I could omit it.
I stated this question already a few months back and the suggestion was to use something like $_.
Sadly, from my perspective, this is:
- less descriptive of what the value would contain (e.g. in case it has to be used in a future feature)
- mostly violates styleguides (i.e. when camel cased variables should be used)
- can not be used more than once (i.e. when one has 1 or more required arguments which are not used)
I would like to propose a last-minute feature to the next major which allows closures to consume unused parameters when they are required due to its order.
Disallowed
https://psalm.dev/r/c2b33c5cae
Allowed
https://psalm.dev/r/a6201b4d4a
Is there a strong veto against this behavior?
Reactions are currently unavailable