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 576911 - New PHP namespace operator \ is not recognized.
New PHP namespace operator \ is not recognized.
Status: RESOLVED DUPLICATE of bug 552605
Product: doxygen
Classification: Other
Component: general
1.5.8
Other All
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2009-03-26 22:51 UTC by Victor Petrov
Modified: 2010-08-28 16:53 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Victor Petrov 2009-03-26 22:51:19 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!
Comment 1 ElGigi 2009-09-16 15:54:53 UTC
I confirm the bug.
It's really annoying, PHP 5.3 is out since some weeks.
Comment 2 faeroth 2010-08-27 16:21:59 UTC
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.
Comment 3 Dimitri van Heesch 2010-08-28 16:53:04 UTC

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