Conversation
| && $conditional->left->value >= ( | ||
| $conditional instanceof PhpParser\Node\Expr\BinaryOp\Smaller ? 0 : 1 | ||
| ) | ||
| // TODO get node type provider here somehow and check literal ints and int ranges |
There was a problem hiding this comment.
you can pass $source from caller method and then do $source->getNodeTypeProvider() if you want
There was a problem hiding this comment.
I can't believe I missed that, I was looking for a StatementsAnalyzer... I'm about done for now, but I'll come fix that in the next day or so.
There was a problem hiding this comment.
otherwise, the rest seems good :) Give me a sign when it's ready ;)
There was a problem hiding this comment.
Ok, well this is actually a bit complicated. I got it all working, but I got a couple RedundantConditions... I have to figure out a way to make the assertion not redundant if $foo and $bar are both non-empty and there's an assertion for count($foo) === count($bar).
Go ahead and merge this, I'll have to dig deeper later. I'll probably see if I can fix this on master along with #7096.
|
Thanks! |
AssertionFinder::hasNonEmptyCountEqualityCheck()and add tests for Infer non-empty assertion from count with variable #8163