-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Ignore parent parameter name mismatch #2315
Conversation
Psalm is listing the mismatch because of interchangeable classes that should use the same variable names, but the current renaming would AFAIK also be a BC break. |
Makes sense, I've ignored the psalm issues instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how to handle this in the next major release though.
Not sure if this is a standard, but lately I've seen |
In fact, in this case are methods with just one argument which I'm not sure if it makes sense to use named parameters. About |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO:
- Named parameters are a new feature, which highlights inconsistencies in APIs
- Such inconsistencies should either be fixed before named args are widely used, or fixed in a backwards compatible way once thy are
Considering that all of these arguments are single, required method arguments, I'll argue that most people won't be using named arguments for that; and if they are then the impact would be caught early (static analysis should catch using named args that don't exist).
Sorry for the back and forth, but it's preferable to rename the arguments for consistency and be done with this. I've left additional comments regarding no-named-arguments
in the linked persistence PR, but for ODM I'd definitely prefer cleaning up the API rather than telling people not to use named args.
This could lead to problems using named arguments in PHP 8
Thanks @franmomu! |
No worries! It's something that has to be discussed. |
This could lead to problems using named arguments in PHP 8Summary
Psalm was failing because of https://psalm.dev/docs/running_psalm/issues/ParamNameMismatch/
UPDATE: It would be BC break to change the parameter as pointed out in #2315 (comment), so ignoring the issue for now.