More precise `array_keys` return type
closes https://github.com/phpstan/phpstan/issues/11928
This pull request has been marked as ready for review.
Just wondering if any of this could also be done inside Type::getKeysArray() as well? to e.g. avoid having to deal with lists outside of it again.
See also https://github.com/phpstan/phpstan-src/pull/2117 where I played around with adding filter support 😊
Nice, sorry, noticed too late and should have mentioned it earlier. Later on, e.g. in https://github.com/phpstan/phpstan-src/pull/3514 I used TrinaryLogic instead of bool in the new Type function. Do you think you can use that too?
I used $strict as bool, because other methods in Type also use it.
Do you see a use-case where Trinary would come in handy?
Not necessarily. If others use that too, then consistency makes sense IMO.
Please fix the conflict.
Please fix the conflict.
resolved.
build errors are unrelated and fixed separately in https://github.com/phpstan/phpstan-src/pull/4104
Thank you!