Skip to content

Tag reference

@yield

The @yield tag documents the type yielded by a Generator, distinct from the type it returns on completion.

Grammar

"@phpstan-yield" <Type> [ <Description> ]
"@psalm-yield" <Type> [ <Description> ]

Examples

The values a generator yields.
/**
* @phpstan-yield User
*/
public function stream(): Generator

Names by platform

phpstan
@phpstan-yield
psalm
@psalm-yield