After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 656778 - Doxygen does not correctly parse @var annotations for PHP class members
Doxygen does not correctly parse @var annotations for PHP class members
Status: RESOLVED DUPLICATE of bug 626105
Product: doxygen
Classification: Other
Component: general
unspecified
Other Linux
: Normal major
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2011-08-17 21:58 UTC by Jonathan Chan
Modified: 2011-12-12 09:34 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jonathan Chan 2011-08-17 21:58:31 UTC
For a quick description of the problem, see this StackOverflow question: http://stackoverflow.com/questions/4325224/doxygen-how-to-describe-class-member-variables-in-php. (Note that the solution mentioned in the sole answer to that problem does not appear to wokr).

Not noted in that question, but present in the output when Doxygen generates documentation for such a file, is the following error:

/path/to/SomeClass.php:13: warning: documented function `path::to::SomeClass::string' was not declared or defined.

This bug is preventing effective usage of Doxygen with PHP.
Comment 1 Dimitri van Heesch 2011-08-18 13:59:38 UTC
Doxygen had the @var command long before PHP related tools introduced it, so you cannot really blame doxygen that it works differently. Same holds for @return.

The @var command is used in doxygen to indicate that a comment block is for a variable that can be found somewhere else, i.e. take the following C code:

----------------- test.c ------------------------
int myVar;

void func()
{
}

------------------ otherfile.dox ----------------

/** @var int myVar
 *  This comment block is for the myVar variable
 */
-------------------------------------------------

So what you are asking for is a different (incompatible!) behavior of @var for PHP code. I'll consider it but I hope you understand that this can be confusing to people.
Comment 2 Jonathan Chan 2011-08-18 17:18:27 UTC
I see. In that case, I suppose it's not worth it to make an exception just for PHP in Doxygen - thanks for the explanation!

Nevertheless, is it possible to "hint" some sort of type for a class member? I understand that this isn't likely, and I suppose I can always just note the expected type in the docstring.
Comment 3 Goran Rakic 2011-12-12 09:34:24 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of bug 626105 ***