What is the correct way to document PHP constants (define) with phpDocumentor

AlexV picture AlexV · Feb 3, 2010 · Viewed 9.3k times · Source

How must we document (with phpDocumentor) constants defined with define() in PHP?

I found nothing in the docs, but found the following example (which I don't see it's use) in the sample2.php:

/**#@+
 * Constants
 */
/**
 * first constant
 */
define('testing', 6);
/**
 * second constant
 */
define('anotherconstant', strlen('hello'));

Anyone can tell me what's the best way to document constants in PHP with phpDocumentor?

Answer

kb. picture kb. · Feb 3, 2010

Define statements are in general only commented with a descriptive text, so that's basically how you comment it.

To read more about the DocBlock template tag, /**#@+, check out the manual page.