0

Often I am passing an array as a constructor parameter. How should I document the allowable values? I have tried a few styles but they look a bit of a mess in phpdoc.

DatsunBing
  • 8,684
  • 17
  • 87
  • 172

1 Answers1

2

There really is no "official" phpdoc way for documenting hashed arrays but here's one way:

/**
 * @param array $options hash of standard options for this class:
 *    int id the id of whatever object
 *    string name name of whoever it is
 *    array sub_option hash of sub options:
 *        int num number description for this index
 *    bool is_good should we do this or not?
 */
 function __construct( $options ){
 }
pogidude
  • 76
  • 1
  • 1
  • 8