-
Notifications
You must be signed in to change notification settings - Fork 0
PHPDoc tags and annotations
Original version is in https://github.com/zonuexe/emacs-php-info/wiki/PHPDoc-tags-and-annotations (Japanese).
Comment notation with @
such as @exapmle
is called tag or annotation. These are similar, but they have different characteristics.
/**
* @Annotation
* @Target("CLASS")
*/
Annotations are introduced mainly by Doctrine. It has syntax with complex expressions with parentheses. Annotations typically contain capital letters and backslashes, so they have slightly different characteristics from tags.
The definition by Doctrine is in Doctrine Annotations — Doctrine Common 2.1 documentation. The parser implementation is doctrine/annotations: Annotations Docblock Parser.
/**
* @deprecated
* @license MIT
*/
Tag syntax is relatively simple compared to annotation. Tokens are generally divided by spaces
and their parsing is basically easy. (However, for each tag corresponding is required.)
These tags are defined in List of tags and Tag reference.
@api
@author
@category
@copyright
@deprecated
@example
@filesource
@global
@ignore
@internal
@license
@link
@method
@package
@param
@property
@property-read
@property-write
@return
@see
@since
@source
@subpackage
@throws
@todo
-
@uses
and@used-by
@var
@version
These tags are defined in Annotating Your Source Code · phan/phan Wiki.
@var
@param
@return
@method
@deprecated
@internal
@suppress
@property
@override
@phan-closure-scope
The proprietary tags implemented in PhpStorm are not documented and we do not have those lists.