-
Notifications
You must be signed in to change notification settings - Fork 545
Fix array_column() with explicit null $index_key
#3970
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
Fix array_column() with explicit null $index_key
#3970
Conversation
179a727 to
eab1722
Compare
hey @staabm, I only saw your refactor in #3785 now because of conflicts :) I think the $indexType should not be nullable to avoid confusion / inconsistency with null vs NullType.
I think your follow-up for the rules does not exist yet, does it? Would it work with a non-nullable indexType too? I did adapt the new helper here with the rebase to keep the fix for the linked issue simple.
@ondrejmirtes I avoid pinging you, but looks like this small fix is a blocker or has conflict potential for that new rule
thanks for the ping
I think the
$indexTypeshould not be nullable to avoid confusion / inconsistency withnullvsNullType.
IIRC its fine, as the rule - as I had it implemted previously in https://github.com/phpstan/phpstan-src/pull/3706/files - does not rely on the nullability of the parameter.
I will have a closer look when re-submitting the new rule
eab1722 to
faa859e
Compare
jfyi, this is an easy one I think and done already for a while
4d58c28
into
phpstan:2.1.x
Thank you!
Closes phpstan/phpstan#12945