Open ohader opened 3 years ago
I found these snippets:
Another similar behavior (related to @psalm-taint-specialize
) can be seen with builder patterns - this use case seems to be more realistic, than my previous example.
https://psalm.dev/r/0807dc3802
Another example, Doctrine DBAL (e.g. https://github.com/psalm/psalm-plugin-doctrine/blob/1.x/stubs/DBAL/QueryBuilder.phpstub) is also implementing builders.
I found these snippets:
Isn't this behaviour correct? https://psalm.dev/r/dfaa9eb1f9
I found these snippets:
Isn't this behaviour correct? https://psalm.dev/r/dfaa9eb1f9
This looks correct now and something actually changed here - which is good (somewhere between a0739b1..6d45003, cannot be more precise, that was the last time my local tests were failing, with most recent state that particular use case looks good).
However... 😉 https://psalm.dev/r/fb660ce147 still reveals some strange behavior.
I found these snippets:
While developing a custom plugin and using individual
DataFlowNode
instances, I was struggling which specialized code locations to use, and for which particular scenarios it is required. For some invocations I got the expected behavior, for others (chained specialized nodes) I got unexpected results - taints were not resolved anymore.I was able to reproduce the behavior outside my custom implementation with a simplified example at https://psalm.dev/r/a409d0a997
echo first($a);
→ ok,TaintedHtml
echo second($b);
→ ok,TaintedHtml
echo first(second($b));
→ missingTaintedHtml
echo second(first($a));
→ missingTaintedHtml