-
Notifications
You must be signed in to change notification settings - Fork 525
Fix missing detection of dead code in expressions #4090
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
bda643b
Fix missing detection of dead code in expressions
staabm a3a6a49
Support method calls / static calls
staabm c2b3e7b
fix assignments
staabm a430885
fix regression
staabm 074877a
Fix NullsafeMethodCall
staabm 1707b28
fix build
staabm 6023250
test nullsafe
staabm 5bf7349
more tests
staabm 82c93d4
fix PHP 7.4
staabm 0cc9483
better names
staabm af69075
fix string interpolation
staabm 0610269
fix func args
staabm 0b29958
fix callables
staabm 0b642df
added regression test
staabm e7d00d1
fix arrays
staabm dfe77ba
fix method calls
staabm 95bb39d
ExpressionResult isAlwaysTerminating is consistent with StatementResult
staabm 4e0c9c0
Added ExpressionResultTest
staabm 89d5780
Add $isAlwaysTerminating to every node-type if-branch
staabm f18867b
fix build
staabm 4e00904
fix arrow-fn and suppress
staabm d0d52d9
implement more cases
staabm cc65f3b
Update NodeScopeResolver.php
staabm 70d67c2
Update NodeScopeResolver.php
staabm 24ff8fd
fix nullsafe
staabm ba52625
fix expectations
staabm 8b2806a
simplify ExpressionResultTest
staabm 15f2b01
add more tests
staabm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The right side might never be executed so this should only mention the left side.
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.
$x && exit();
should be falseUh oh!
There was an error while loading. Please reload this page.
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.
it is
false
, see https://github.com/phpstan/phpstan-src/pull/4090/files#diff-fa85cdb8d6b73f343f042bbbe433ecc95119bf3dc5e76cc7291563d1c49cbd0dR87I guess you was looking at an outdated version of the PR while commenting