take subtracted type into account in MixedType->isArray()#1656
take subtracted type into account in MixedType->isArray()#1656ondrejmirtes merged 7 commits intophpstan:1.8.xfrom
MixedType->isArray()#1656Conversation
tests/PHPStan/Type/MixedTypeTest.php
Outdated
There was a problem hiding this comment.
subtracting only array<int, string> could still leave e.g. a array<string, mixed> within the mixed.
therefore I am wondering, whether the only case where $mixed->isArray() can say NO is, when a general array is substracted?
There was a problem hiding this comment.
Exactly. Switching the callee and the argument works even when more than just an array are subtracted, like array|null for example.
There was a problem hiding this comment.
I just see #1656 (comment), so I think we are on the same page.. will adjust the PR.
ondrejmirtes
left a comment
There was a problem hiding this comment.
While you're at it, please do all the other methods as well.
|
implemented in all methods I found useful. here are a few notes:
|
Exactly, it should just call
Can we get a union of all offset-accessible types? Is it
Yes, definitely, the current code is wrong. |
00b7b03 to
e131ca2
Compare
|
implemented and rebased |
|
Thank you. |
No description provided.