Open stof opened 5 years ago
+1
Now I always add at the beginning of twig template
{# @var \App\Entity\Foo foo #}
{# @var \App\Entity\Bar[] bar #}
{# @var string|null baz #}
and it kind of works sometimes.
I would like this feature to be officially supported and the autocomplete and type resolving to be as good as in regular php files.
When using a
{# @var #}
comment in Twig to document the type of a variable, union types are not supported properly. Only the first type of the union is used by the autocomplementation after that.