I mean, it is possible to do that in PHP, but I want to reflect this in
the documentation. For example, I have written a DateTime class and it
can be constructed without a parameter to get "now", with an integer
(meaning unix timestamp), three integers denoting year, month and day,
and so on.
I would like the documentation to treat them as if they were different
constructors, instead of one without parameters (it calls
func_get_args() to read its parameters) that handles all the possibilities.
I tried:
/// @fn clsDateTime::__construct()
/// Construct a clsDateTime object representing now.
/// @fn clsDateTime::__construct($mixTimeStamp)
/// Construct a clsDateTime object representing the given timestamp.
/// If the timestamp is numeric, it is treated as a unix timestamp, with
decimal seconds if it is a float.\n
/// If it is a string, it is parsed as a delimited set of the values for
year, month, day, hour, minute and second,
/// unless the string is one of the special values "now", "today", or
"tomorrow".\n
/// If it is a clsDateTime object, the new object is a copy.
/// @fn clsDateTime::__construct($intYear, $intMonth, $intDay)
/// @param integer $intYear The year as a number
/// @param integer $intMonth The month as a number
/// @param integer $intDay The day of the month as a number.
/// Construct a clsDateTime object representing the given date.
But all this does is to combine all the above sections into one. It is
possible to have Doxygen create overloaded documentation for a language
that does not really support overloading, just for clarity?
Best regards,
Willem Bogaerts
|