rgvcorley
rgvcorley

Reputation: 2933

PHPDoc: How to document different class property options

Is there any way with phpdoc to document the different values that a class property can take and what effect this will have. For example:-

class SomeClass {

   /**
   * Cell text align
   * 
   * null - table default
   * l - left align
   * r - right align
   * c - centre align
   * j - justify
   */
   public $align;

   Some code
}

Is there any way to make the value-description pairs be parsed by phpdoc so that it will turn them into a definition list or such like?

Upvotes: 2

Views: 663

Answers (1)

cmbuckley
cmbuckley

Reputation: 42547

Something like this will become a <ul> in the documentation output:

class SomeClass {

   /**
    * Cell text align
    * 
    * Possible values: 
    * - null - table default
    * - l - left align
    * - r - right align
    * - c - centre align
    * - j - justify
    */
   public $align;

   // Some code
}

From the manual page on DocBlock description details.

Upvotes: 2

Related Questions