Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0a1

Doc Bug #12459 @subpackage does not fix name conflicts
Submitted: 2007-11-16 16:07 UTC
From: masterkaos21 Assigned: ashnazg
Status: Closed Package: PhpDocumentor (version 1.4.0)
PHP Version: 4.4.7 OS: Debian
Roadmaps: 1.4.1    
Subscription  


 [2007-11-16 16:07 UTC] masterkaos21 (Kris Ko)
Description: ------------ Create 2 files. Set both PageDoc package to Foo Set one of the files subpackage to Bar set the other files subpackage to Baz Create a function in each of the files with the exact same name. Run the documentor on the 2 files, and only 1 of the functions is documented even though they are in different sub packages Test script: --------------- File 1: <?php /** * @package Foo * @subpackage Bar */ /** * Sample function * @param bool $foo A test param */ function fooBar($foo) { } ?> File 2 <?php /** * @package Foo * @subpackage Baz */ /** * A sample function * @param bool $foo Test param 1 * @param bool $bar Test param 2 */ function fooBar($foo, $bar) { } ?> Expected result: ---------------- Package Foo -subpackage bar -functions - foobar -subpackage baz -functions -foobar Actual result: -------------- Package Foo -subpackage bar -functions - foobar -subpackage baz

Comments

 [2007-11-17 05:58 UTC] cellog (Greg Beaver)
this is by design. subpackage is intended to help categorize an actual PHP package. In PHP itself, you can't have two functions with the same name in the same script, phpDocumentor treats this the same way - all names within a package must be unique. subpackage is simply to help with visual organization of a package into structure.
 [2007-11-17 11:10 UTC] ashnazg (Chuck Burgess)
Thanks for the clarification, Greg. This bug was my fault, then... it came from a Help topic at SF (https://sourceforge.net/forum/message.php?msg_id=4627158), as I had assumed subpackages would allow further separation under packages just like the package separation, and I didn't spot anything in the manual to say otherwise. I'll take this bug as a todo item to add some verbiage to at least the @subpackage tag page that highlights this point.
 [2007-11-19 16:53 UTC] ashnazg (Chuck Burgess)
Forgot to un-bogus this when I changed its scope...
 [2007-12-07 12:12 UTC] ashnazg (Chuck Burgess)
Patch adds verbiage to the manual's subpackage tag doc. Committed to CVS.