Skip to content

Tag reference

@filesource

The @filesource tag tells documentation tooling to embed a full, syntax-highlighted copy of the current file’s source code alongside the documentation generated for it. It is typically placed once, in the file-level docblock near the top of the file, rather than repeated on individual elements.

Grammar

"@filesource" [ <Description> ]

Examples

Requesting the source listing for an entire file.
/**
* Mailer transport implementations.
*
* @filesource
*/
With a description explaining why the listing is useful here.
/**
* @filesource Reference implementation; read alongside the
* interface.
*/

Names by platform

phpdocumentor
@filesource

Parsing a @filesource tag produces a FilesourceTag instance. Being a pure marker, it adds nothing beyond the $name and optional $description every Tag already carries.

final class FilesourceTag extends FlagTag {}

This tag is still part of phpDocumentor’s current tag reference and is not deprecated — phpDocumentor tag reference. It is parsed here for compatibility with classic-style docblocks.