Introduce __stringnotstringable#4457
Conversation
20054a8 to
ea50ab0
Compare
ea50ab0 to
1090888
Compare
ondrejmirtes
left a comment
There was a problem hiding this comment.
Look at StringAlwaysAcceptingObjectWithToStringType. Every new Type implementation also has to override isSuperTypeOf to give correct answers.
You can test that in TypeCombinatorTest::testUnion and testIntersect.
c33b0a4 to
dd1ee58
Compare
dd1ee58 to
478b6d4
Compare
478b6d4 to
e184313
Compare
| @@ -0,0 +1,98 @@ | |||
| <?php | |||
There was a problem hiding this comment.
in phpstan/phpstan#6560 (comment) there was mentioned this does not depend on strict types.
I think it would be useful to have another test with strict-types enabled
(in case this is not already covered somewhere)
dcf10e1 to
78620a0
Compare
78620a0 to
1ae0a99
Compare
| <?php | ||
|
|
||
| declare(strict_types=1); |
There was a problem hiding this comment.
if we put declare(strict_types=1); on line 1 - right behind the starting tag - you might re-use the very same test without duplicating expectations in CallToFunctionParametersRuleTest ?
6dc92cd to
e41069c
Compare
staabm
left a comment
There was a problem hiding this comment.
lgtm. needs cs-fix though
Naming to debate ?
__stringwithoutstringable?__strictstring?intval($stringable)is never allowed, even without strict_types.The current check in FunctionCallParameterCheck is
either we're doing something like
either we have to introduce the opposite of StringAlwaysAcceptingObjectWithToStringType like I did.
Closes phpstan/phpstan#6560
Closes #1005