diff --git a/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php b/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php index 2c3943bfb..8df27fac3 100644 --- a/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php @@ -343,7 +343,6 @@ class StatementsAnalyzer extends SourceAnalyzer && !$context->collect_initializations && !$context->collect_mutations && !($stmt instanceof PhpParser\Node\Stmt\Nop) - && !($stmt instanceof PhpParser\Node\Stmt\InlineHTML) && !($stmt instanceof PhpParser\Node\Stmt\Function_) && !($stmt instanceof PhpParser\Node\Stmt\Class_) && !($stmt instanceof PhpParser\Node\Stmt\Interface_) diff --git a/tests/UnusedCodeTest.php b/tests/UnusedCodeTest.php index 52f12e174..d34ef54b9 100644 --- a/tests/UnusedCodeTest.php +++ b/tests/UnusedCodeTest.php @@ -1574,6 +1574,13 @@ class UnusedCodeTest extends TestCase ', 'error_message' => 'UnevaluatedCode', ], + 'exitInlineHtml' => [ + 'foo + ', + 'error_message' => 'UnevaluatedCode', + ], ]; } }