Explicit never early terminates#366
Conversation
6f9fd27 to
c22522d
Compare
ondrejmirtes
left a comment
There was a problem hiding this comment.
This is almost perfect PR :) Please test it in a more modern way - see NodeScopeResolverTest::testFileAsserts - add a new dataProvider in it. You can use assertVariableCertainty function inside the test file. Thanks.
c22522d to
fd6f35c
Compare
|
@ondrejmirtes I updated the test |
fd6f35c to
f0df73c
Compare
There was a problem hiding this comment.
Needs to start with data as any other data provider here.
There was a problem hiding this comment.
I'm not even sure if these are executed. They might not be. Have you seen them fail?
The typical test here should be this instead:
if (rand(0, 1)) {
$a = 1;
} else {
Foo::doBarPhpDoc();
}
assertVariableCertainty(TrinaryLogic::createYes(), $a);|
Yeah, I just verified that the asserts are not verified because they're "dead code". I'll bring it over the finish line myselfů |
f0df73c to
410c3ef
Compare
|
Thank you. There needs to be a second part - verifying that a function with |
Closes phpstan/phpstan#2638