-
Notifications
You must be signed in to change notification settings - Fork 2
Generate inverse 'if' expression from Expression AST #102
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
base: 1.x
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 1.x #102 +/- ##
============================================
+ Coverage 96.97% 97.08% +0.10%
- Complexity 491 496 +5
============================================
Files 62 62
Lines 1454 1474 +20
============================================
+ Hits 1410 1431 +21
+ Misses 44 43 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -257,7 +257,7 @@ public static function configurationWithoutTargetProvider(): iterable | |||
], | |||
], | |||
], | |||
'if' => "obj.owner !== null && (obj.owner.firstName === 'John')", | |||
'if' => 'obj.owner !== null && ((obj.owner.firstName === "John"))', |
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.
when converting some types of nodes to string, they are wrapped in parentheses so we end up with double parentheses.
not sure if we should handle this or just leave it be.
940fe49
to
9d58401
Compare
Currently, we are using
str_replace
for generating inversePurgeOn::if
expressions. This can lead to invalid expressions if e.g. method name containsobj
('obj.getobj()'
).To avoid this, expression syntax tree is traversed so we can correctly detect where
obj
is called.