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
Disallow ksorting lists #7019
Disallow ksorting lists #7019
Conversation
I'm not a fan of this one, ksort is hardly a function to transform types, so RedundantCast feels very weird here... However, I couldn't find a more adapted issue and I'm not sure this case is common enough to create a new issue... |
I'd suggest to add |
I was not clear, I meant that I was not a fan of this being classified as RedundantCast but the feature seem fine though. I'm okay with a RedundantFunctionCall, thinking about it more, this could indeed be reused (a dumb example, but a call to max() with a single value could fit in there). |
Done! |
Cool! Thanks! |
@weirdan Can I let you merge that and updating the baseline for phpunit? |
Thanks! |
Fixes #7018.
Settled on the same logic used for
array_values
, as lists can only be constructed by appending elements to an array or by usingarray_values
itself, in both cases they are sorted by default.