-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encapsed literal strings #8164
Encapsed literal strings #8164
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can pass $source from caller method and then do $source->getNodeTypeProvider()
if you want
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise, the rest seems good :) Give me a sign when it's ready ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, well this is actually a bit complicated. I got it all working, but I got a couple RedundantCondition
s... 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