@use
Traits can be generic too, and PHP's use keyword for pulling a trait into a class carries no syntax for type arguments. @use supplies them, mirroring what @extends does for parent classes and @implements does for interfaces — for example a caching trait that needs to know what kind of value it is caching.
"@use" <Type> [ <Description> ]
Parsing a @use tag produces a tag exposing $type — the TypeNode naming the trait with its type arguments — along with the inherited $name and $description.
final class UseTag extends InheritanceTag
{
// extends TypedTag; adds a computed
// TypeNode $type getter on top of
// $name and $description.
}
The alias @template-use is also recognized and parses to the same UseTag instance. See also @extends and @implements for the equivalent tags used on a generic parent class or interface.
05 July 2026