psalm-plugin-symfony
psalm-plugin-symfony copied to clipboard
Template variables with an underscore lead to errors in taint analysis
The check in AnalyzedTemplatesTainter for Twig variables just checks for ([a-zA-Z]+)
while Twig variables could contain other characters (like _
). Having a variable named my_result
leads to:
Uncaught Exception: Argument 2 passed to Psalm\SymfonyPsalmPlugin\Twig\TemplateFileAnalyzer::getTaintNodeForTwigNamedVariable() must be of the type string, null given, called in /Users/myuser/projects/myapp/vendor/psalm/plugin-symfony/src/Twig/AnalyzedTemplatesTainter.php on line 45
@binarious thank you for the report