-
Notifications
You must be signed in to change notification settings - Fork 508
Rework ArrayReplaceFunctionReturnTypeExtension #3958
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
base: 1.12.x
Are you sure you want to change the base?
Conversation
293ea40
to
2e5bfcf
Compare
This pull request has been marked as ready for review. |
I know I'm maybe a bit fast suggesting this, but we could create a |
Yeah, I would prefer this to be done in a follow up PR to separate (and validate separately by ondrej)
|
5dea1cc
to
a8f870a
Compare
/cc @herndlm Waiting for LGTM from you here :) |
I guess this is fine. And also brings value of course. Let's see if we can refactor array_merge and array_replace stuff a bit as follow-up I'd say :) |
Close phpstan/phpstan#12828
I basically copy the ArrayMergeFunctionReturnTypeExtension with the following change
phpstan-src/src/Type/Php/ArrayMergeFunctionDynamicReturnTypeExtension.php
Line 87 in 4c41073
$keyType instanceof ConstantIntegerType ? null : $keyType,
is replaced by$keyType
becausephpstan-src/src/Type/Php/ArrayMergeFunctionDynamicReturnTypeExtension.php
Line 106 in 4c41073
if (!(new IntegerType())->isSuperTypeOf($keyType)->yes()) {
is replaced byif (!$argType->isList()->yes()) {
because of the same reason.