Twig has just added a new types tag which will be the official way of documenting variable types.
This can eventually replace the community convention of using {# @var #} comments.
Aside from official support and specification, comments have one major downside: they aren't added to the AST, so Twig extensions can't use them.
Twig has just added a new
typestag which will be the official way of documenting variable types.This can eventually replace the community convention of using
{# @var #}comments.Aside from official support and specification, comments have one major downside: they aren't added to the AST, so Twig extensions can't use them.