Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 747
AlexV Avatar asked Feb 03 '10 14:02

AlexV


3 Answers

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.

like image 78
kb. Avatar answered Nov 19 '22 20:11

kb.


You have at phpDoc.org the elements that can be documented.

You also have an example of documenting a define() (the second piece of code and surrounding paragraphs).

like image 23
xOneca Avatar answered Nov 19 '22 21:11

xOneca


/**
*@const
*/
const testing=6;
const anotherconstant=strlen('hello');

Try this you will See it As Constant

like image 1
Dishant Ved Avatar answered Nov 19 '22 21:11

Dishant Ved