Skip to content

Tag reference

@category

The @category tag assigns a package to a broad logical category, letting documentation tooling group unrelated packages into sections such as Database, Networking, or Templating when rendering an index. It is a coarser-grained sibling of @package and @subpackage: where those two narrow down to a specific module, @category places that module within a wider organizational scheme.

Grammar

"@category" [ <Description> ]

Examples

Placing a package under a broad category.
/**
* @category Database
* @package Connection
*/
With additional context about the grouping.
/**
* @category Database Drivers and connection pooling for relational
* stores.
*/

Names by platform

phpdocumentor
@category

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

final class CategoryTag extends FlagTag {}

@category is still part of phpDocumentor’s current tag reference, but phpDocumentor’s own page explicitly calls it deprecated, noting that “support may be removed in a future version” — phpDocumentor tag reference. It remains here for compatibility with docblocks written against the classic toolchain.