Docblock

A docblock, or docblock comment, is a special kind of comment used to document any structure: classes, constants, traits, interfaces, variables, functions, methods, and properties. It is written in a specific format and is typically placed just before the element it describes. Docblocks are used by tools like phpDocumentor, PHPDoc, and IDEs to generate documentation and provide code hints.

Docblock improve readability, enables IDE features and automate reference documentation generation.

<?php

/**
 * A brief description of the function.
 *
 * A more detailed description, if needed.
 *
 * @param type $parameter_name Description of the parameter
 * @return type Description of the return value
 */
function exampleFunction($parameter_name) {
    // Function code here
    return $result;
}

?>

Documentation

See also PHPDoc reference.

Related : Self-documenting, Documentation, Readability, Block, Explanation

Related packages : phpdocumentor/phpdocumentor, php-di/phpdoc-reader, phpowermove/docblock