GNOME Bugzilla – Bug 656778
Doxygen does not correctly parse @var annotations for PHP class members
Last modified: 2011-12-12 09:34:24 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.
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.
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.
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 ***