Commenting PHP DocBlocks

This procedure describes how to add PHPDoc Comments to PHP elements.

 

To create a PHPDoc Comment:

  1. In the line above the code for the PHP element, enter the DocBlock characters /** and press Enter.
    -Or- Right-click the relevant element in the Outline View and select Source | Add PHPDoc.

A PHPDoc Comment will be created with several parameters to be edited with the relevant information.

Usage Example

Example:

When creating a PHPDoc Comment for the following function:

public function add ($a, $b) {

    return $a + $b;

}

 the following comment will be created:

//**

 * Enter description here...

 *

 * @param unknown_type $a

 * @param unknown_type $b

 * @return unknown

 */

The comments should now be edited with the relevant description and parameters.

 

 

Related Links

Related Links:

Commenting Code

Commenting PHP Code

phpDoc Comments