Conversation
|
for now I have implemented the |
1337c88 to
8db02be
Compare
|
Type narrowing is a separate concern, I wouldn't do that here. |
ondrejmirtes
left a comment
There was a problem hiding this comment.
I don't see the table of == comparison described anywhere in this PR https://www.php.net/manual/en/types.comparisons.php.
All types need to take into account being compared to any other type. For example this implementation in NullType is too naive:
return $type->isNull()->toBooleanType();Because all of the following examples are true:
null == []
null == false
null == 0
null == ""|
Also an idea for a preliminary or a future PR - |
0cff8e4 to
16fb924
Compare
|
I have implemented a few basic types and added tests for them in btw: this PR will get really big if we implement all combinations for all types here. thank you |
3fe288d to
9aed5d1
Compare
ondrejmirtes
left a comment
There was a problem hiding this comment.
I like StringType::looseCompare but otherwise it's still gonna be a lot of work 😅 And we're not even diving into type narrowing now. I think it's obvious why I was avoiding this topic until now 😂
20be7b9 to
018d83e
Compare
closes phpstan/phpstan#8224