You will all be familiar with attributes, no matter what language you use, or how you choose to use it. An attribute is a tag inside a comment block, which has a special meaning somewhere, somehow. In the majority of cases, the tags are processed during documentation generation:
/** * Creates a new record and returns its serial. * @param string $name The title of the record to create. * @return int The serial number of the newly created record. */ public function createRecord( $name ) { ... }
In the above example, the tags @param
and @return
are
attributes. When generating documentation for the function, those two lines have
special significance, because they will end up in a particular location in the
documentation template, with a particular type of formating, and perhaps a
link to another part of the documentation.