-
-
Notifications
You must be signed in to change notification settings - Fork 380
Fix multiline variable in array and with expr not be coverage #955
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
Fix multiline variable in array and with expr not be coverage #955
Conversation
a11c1e5
to
b006a62
Compare
please submit this PR into my #949 PR, the analysis is rewritten a lot |
@mvorisek you cannot expect a new contributor to know and inspect work that hasn't been merged yet. We either complete and merge your work and ask @kayw-geek to rebase his PR afterwards, or simply integrate the new test case into #949 tests and fix it by ourselves. |
It took me half a day to find this problem, and I really want to be a contributor. I will feel honored. |
Codecov Report
@@ Coverage Diff @@
## main #955 +/- ##
============================================
+ Coverage 85.06% 85.21% +0.15%
- Complexity 1166 1172 +6
============================================
Files 69 69
Lines 3422 3464 +42
============================================
+ Hits 2911 2952 +41
- Misses 511 512 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
8c91c33
to
df0b90f
Compare
b613841
to
ca65ac5
Compare
@mvorisek Excuse me, Could you review this PR again. Thanks 🙏 |
ca65ac5
to
1a01b19
Compare
see
to fix the #953 you need to statically analyse the local variable scope for each evaluated node to be able to determine if variable was optimized out at compile time (const expr) or not |
So, your meaning was I need to use the method in the #939 to fix these unstable problems? |
So, your meaning was I need to use the method in the #939 to fix these unstable problems? |
you need to evaluate every (sub) AST tree for const expr and track variable scope for each, like done by php optimizer or other static analysers like phpstan in a meantime, please also review #949, it will help you to understand some edge cases |
#964 should have fixed this too, @kayw-geek can you check please? |
I think the case need be coverage
Fix #948