PHPDoc

PHPDoc is a software documentation tool based on Javadoc. It is used, variables, functions, methods and classes to document in PHP source code to create using this information, documentation, such as HTML-based. Was created the term around the year 2000, when a system modeled on Javadoc documentation tool was presented in a presentation, which is under the PHP license.

Example

Where is a fictional method whose description, parameters and return value should be defined:

/ **   * Get all image nodes.   *   * @ Param \ DOMDocument $ document the \ DOMDocument instance   * @ Param boolean $ strict If the document Has to be valid   *   * @ Return \ DOMNode   * /   public function getImageNodes ( \ DOMNode $ node, $ strict = true)   {       / / ...   } The enclosed in asterisks Details of the description of the method parameters are typically made ​​for PHPDoc comments and do in this format. In the example, with the help of @ param the two functional parameters defined ( in the order of data type, variable name, brief explanation ), as well as the return data type is specified.

Benefit

Based on the descriptions, for example for a method, a PHPDoc parser can generate an API documentation, as required function parameters clearly explained. Another advantage is that development environments capture these comments and thus make code completion. You will also warn if such an object type is passed that does not comply with the specifications of the PHPDoc comment.

648494
de