How can comments within a function in PHP be effectively utilized for documentation with phpDocumentor?

To effectively utilize comments within a function in PHP for documentation with phpDocumentor, you can use special comment tags such as @param, @return, and @throws to provide information about the function's parameters, return values, and potential exceptions. These comments should be placed directly above the function declaration and follow a specific format to be recognized by phpDocumentor.

/**
 * This function calculates the sum of two numbers.
 *
 * @param int $num1 The first number.
 * @param int $num2 The second number.
 * @return int The sum of the two numbers.
 */
function calculateSum($num1, $num2) {
    return $num1 + $num2;
}