PHPDoc
suggest changeSyntax
- @api
- @author [name] [<email address>]
- @copyright <description>
- @deprecated [<“Semantic Version”>][:<“Semantic Version”>] [<description>]
- @example [URI] [<description>]
- {@example [URI] [:<start>..<end>]}
- @inheritDoc
- @internal
- {@internal [description]}
- @license [<SPDX identifier>|URI] [name]
- @method [return “Type”] [name]([“Type”] [parameter], […]) [description]
- @package [level 1]\[level 2]\[etc.]
- @param [“Type”] [name] [<description>]
- @property [“Type”] [name] [<description>]
- @return <“Type”> [description]
- @see [URI | “FQSEN”] [<description>]
- @since [<“Semantic Version”>] [<description>]
- @throws [“Type”] [<description>]
- @todo [description]
- @uses [file | “FQSEN”] [<description>]
- @var [“Type”] [element_name] [<description>]
- @version [“Semantic Version”] [<description>]
- @filesource - Includes current file in phpDocumentor parsing results
- @link [URI] [<description>] - Link tag helps to define relation or link between structural elements.
Remarks
“PHPDoc” is a section of documentation which provides information on aspects of a “Structural Element” — PSR-5
PHPDoc annotations are comments that provide metadata about all types of structures in PHP. Many popular IDEs are configured by default to utilize PHPDoc annotations to provide code insights and identify possible problems before they arise.
PHPDoc annotations are not part of the PHP core. PSR-5 stayed a draft and was abandoned. The later PHP-FIG proposal is PSR-19.
PHPDoc annotations live in DocBlocks, multiline comments that open with /**:
/**
*
*/
The full PHP-FIG standards draft is available on GitHub.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents