phpDoc(PHP Documentor) 标签使用指南

phpDocumentor 标签与 JavaDoc 很相似。只有位于文本块(DocBlock)新行开头的标签才会被解析,并且在单行范围内,@ character后面的文本可以保持任意长度。例如:

<?php
/**
 * tags demonstration
 * @author this tag is parsed, but this @version tag is ignored
 * @version 1.0 this version tag is parsed
 */
?>

任何 phpDocumentor 无法辨识的标签将不会被解析,但会将其以文本形式作为文本块的一部分进行输出。以下是 phpDocumentor 支持的标签列表

  • @access
  • @author
  • @copyright
  • @deprecated
  • @example
  • @ignore
  • @internal
  • @link
  • @method
  • @package
  • @param
  • @return
  • @see
  • @since
  • @tutorial
  • @version

此以上常规标签(regular tags)外,phpDocumentor 中还有一种行内标签(inline tags)。与常规标签不同,行内标签不要求出现在新行的开头,而可以出现在文本流中。以下几个常用的行内标签:

  • inline {@internal}
  • inline {@inheritdoc}
  • inline {@link}