GNOME Bugzilla – Bug 576911
New PHP namespace operator \ is not recognized.
Last modified: 2010-08-28 16:53:04 UTC
Please describe the problem: Starting with PHP 5.3 the namespace operator is \ (backslash). Accessing static methods in classes is still done with ::. So the canonical way to access a static method is: \NS1\SomeClass::method(). Outside a namespace, the same method could be referenced as NS1\SomeClass::method() (no leading backslash). Doxygen probably expects :: as the namespace operator, so it doesn't detect namespace properly. The problem can be seen when class NS2\SomeClass extends NS1\SomeClass. Doxygen ignores one class, because it probably thinks there's a naming conflict. I tried to declare a new group for each namespace (with @addgroup) and then manually add each class to the appropriate group with @ingroup, but the inheritance is still a problem. Both groups reference the same 'Class' object, even though NS2\SomeClass has '@ingroup NS2' and NS1\SomeClass has '@ingroup NS1'. Declaring the classes in PHP as 'class NS1::SomeClass' triggers a parsing error. This also results in no inheritance diagram for those classes. I also tried to document each class with '@class NS1::SomeClass' and '@class NS2::SomeClass', but Doxygen still showed documentation for 'SomeClass' separately (also no members from both NS1::SomeClass and NS2::SomeClass'). I am not sure how difficult it is to implement this change in Doxygen, but I hope it is not that complicated. Thanks in advance! P.S.: Also, I get the "Warning: Found unknown command `\extends'" warning when I try to use @extends SomeOtherClass. This is the same Doxygen version, 1.5.8. Steps to reproduce: 1. Declare two classes with the same name that extend each other, but are in 2 different namespaces, such as NS2\SomeClass extends NS1\SomeClass 2. Use only @brief for both of them. 3. Set EXTRACT_ALL to true. 4. Run Doxygen. Actual results: Well, Doxygen thinks there are two declarations for the class SomeClass and does not attach the two classes to the appropriate namespace. Instead, it only creates one entry for the class SomeClass. Expected results: I expect to see the documentation for NS1 and NS2, each having an entry for SomeClass. NS2\SomeClass should be shown as extending NS1\SomeClass. Does this happen every time? Yes, unfortunately. Other information: If there's a way to quickly get around this issue, I'd be more than happy to know what it is. Thank you!
I confirm the bug. It's really annoying, PHP 5.3 is out since some weeks.
Will this bug be fixed soon? I am using the latest Doxygen version and this bug still occurs for me trying to document my PHP framework.
*** This bug has been marked as a duplicate of bug 552605 ***