diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php index 545aebfc2..e6dc20960 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php @@ -232,8 +232,7 @@ class CastAnalyzer $type = Type::getArray(); } - if ($statements_analyzer->data_flow_graph instanceof \Psalm\Internal\Codebase\VariableUseGraph - ) { + if ($statements_analyzer->data_flow_graph) { $type->parent_nodes = $stmt_expr_type->parent_nodes ?? []; } diff --git a/tests/TaintTest.php b/tests/TaintTest.php index f7e74b93f..f36dd80b4 100644 --- a/tests/TaintTest.php +++ b/tests/TaintTest.php @@ -2182,6 +2182,16 @@ class TaintTest extends TestCase 'error_message' => 'TaintedHtml', ], */ + 'castToArrayPassTaints' => [ + ' 'TaintedSql', + ], ]; }