4.5 document comments describe php classes, constructors, methods, and fields ). Each document annotation is placed in the annotation separator/**... */, and a comment corresponds to a class or member. This annotation should be prior to the declaration:/*** describes some of this class... */classExample {... note SyntaxHighlighte
4.5 document comment
This document describes php classes, constructors, methods, and fields ). Each document annotation is placed in the annotation separator/**... */, and a comment corresponds to a class or member. The comment should be prior to the declaration:
/**
* Describes some of the classes...
*/
Class Example {...
Note that the top-level class is not indented, and its members are indented. The first line (/**) of the document comment of the description class does not need to be indented; the subsequent document comment lines are indented by 1 (vertical alignment of the asterisks ). Member, including the constructor, the first line of the comments in the document is indented by 4 cells, and then each line is indented by 5 cells.
If you want to provide information about classes, variables, or methods that are not suitable for writing in the document, you can use implementation block annotations (see 5.1.1) or a single line comment that follows the declaration (see 5.1.2 ). For example, the implementation details of a class should be placed in the implementation block comment followed by the class declaration, rather than in the document comment.
Document comments cannot be placed in the definition block of a method or constructor, because the program associates the first declaration after the document comments with it.