FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18872&edit=1

ID: 18872
Updated by: demon.gene@gmail.com
Reported By: drunkenstranger at gmail dot com
Summary: Class tree puts comma uncorrectly in interfaces list
Status: Open
Type: Bug
Package: PhpDocumentor
Operating System: Windows XP
Package Version: SVN
PHP Version: 5.2.12
-Roadmap Versions:
+Roadmap Versions: 1.4.4
New Comment:

-Roadmap Versions:
+Roadmap Versions: 1.4.4



Previous Comments:
------------------------------------------------------------------------

[2011-09-25 10:01:03] drunkenstranger

This patch works only for HTML:frames converter (you can fix another
manually - just replace original getRootTree method).

Also this patch fixes:
http://pear.php.net/bugs/bug.php?id=18870
http://pear.php.net/bugs/bug.php?id=18871

------------------------------------------------------------------------

[2011-09-25 09:58:49] drunkenstranger

Added #patch bug:18872;patch:classtree-fix.patch;revision:1316941129;.

------------------------------------------------------------------------

[2011-09-25 09:38:10] drunkenstranger

Description:
------------
Class tree puts comma uncorrectly in interfaces list.

Test script:
---------------
<?php
/** Test file for MyPackage2 class tree
* @package MyPackage */

/** @package MyPackage */
interface MyInterface {}

/** @package MyPackage */
interface MyInterface2 {}

/** @package MyPackage */
interface MyInterface3 {}

/** @package MyPackage */
class MyClass implements MyInterface, MyInterface2, MyInterface3 {}


/** @package MyPackage */
class MyClass2 extends MyClass {}

?>

Expected result:
----------------
Root class MyClass

MyClass (implements MyInterface, MyInterface2, MyInterface3)
MyClass2


Actual result:
--------------
Root class MyClass

MyClass (implements MyInterface, MyInterface2MyInterface3)
MyClass2

------------------------------------------------------------------------

Search Discussions

  • Demon Gene at Oct 12, 2011 at 7:39 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=18872&edit=1

    ID: 18872
    Updated by: demon.gene@gmail.com
    Reported By: drunkenstranger at gmail dot com
    Summary: Class tree puts comma uncorrectly in interfaces list
    Status: Open
    Type: Bug
    Package: PhpDocumentor
    Operating System: Windows XP
    Package Version: SVN
    PHP Version: 5.2.12
    -Assigned To:
    +Assigned To: ashnazg
    Roadmap Versions:
    New Comment:

    -Assigned To:
    +Assigned To: ashnazg
    Tried to verify this behavior using v1.4.3 against PHP 5.3.8 and 5.2.17,
    but tests are being affected by interface names failing to appear in the
    place where the commas are expected. Presumably this is due to some
    combination of bug 18870 and bug 18871, and the bug reporter likely
    discovered this bug when patching his code for the other two bugs. I'll
    have to get the other two bugs patched and tested before verifying this
    bug behavior, I think.

    As an aside, the issue is irrelevant when using PHP 4.4.9.


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-10-07 21:11:36] ashnazg

    -Roadmap Versions:
    +Roadmap Versions: 1.4.4


    ------------------------------------------------------------------------

    [2011-09-25 10:01:03] drunkenstranger

    This patch works only for HTML:frames converter (you can fix another
    manually - just replace original getRootTree method).

    Also this patch fixes:
    http://pear.php.net/bugs/bug.php?id=18870
    http://pear.php.net/bugs/bug.php?id=18871

    ------------------------------------------------------------------------

    [2011-09-25 09:58:49] drunkenstranger

    Added #patch bug:18872;patch:classtree-fix.patch;revision:1316941129;.

    ------------------------------------------------------------------------

    [2011-09-25 09:38:10] drunkenstranger

    Description:
    ------------
    Class tree puts comma uncorrectly in interfaces list.

    Test script:
    ---------------
    <?php
    /** Test file for MyPackage2 class tree
    * @package MyPackage */

    /** @package MyPackage */
    interface MyInterface {}

    /** @package MyPackage */
    interface MyInterface2 {}

    /** @package MyPackage */
    interface MyInterface3 {}

    /** @package MyPackage */
    class MyClass implements MyInterface, MyInterface2, MyInterface3 {}


    /** @package MyPackage */
    class MyClass2 extends MyClass {}

    ?>

    Expected result:
    ----------------
    Root class MyClass

    MyClass (implements MyInterface, MyInterface2, MyInterface3)
    MyClass2


    Actual result:
    --------------
    Root class MyClass

    MyClass (implements MyInterface, MyInterface2MyInterface3)
    MyClass2

    ------------------------------------------------------------------------
  • Drunkenstranger at Oct 13, 2011 at 10:41 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18872&edit=1

    ID: 18872
    Comment by: drunkenstranger@gmail.com
    Reported By: drunkenstranger at gmail dot com
    Summary: Class tree puts comma uncorrectly in interfaces list
    Status: Assigned
    Type: Bug
    Package: PhpDocumentor
    Operating System: Windows XP
    Package Version: SVN
    PHP Version: 5.2.12
    Assigned To: ashnazg
    Roadmap Versions:
    New Comment:

    Nope, this tested with clear SVN trunk head revision (changed only
    "phpdoc" & "phpdoc.bat"). But only with HTML:frames:default converter.
    Review this with 318072 revision - the same result.

    /*

    https://svn.php.net/repository/pear/packages/PhpDocumentor/trunk/phpDocumentor/Converters/HTML/frames/HTMLframesConverter.inc:318062
    lines:1361-1368
    */
    foreach ($implements as $i => $interface) {
    if ($i && $i != count($implements) - 1) $my_tree .= ', ';
    if ($link = $this->getLink('object ' . $interface)) {
    $my_tree .= $this->returnSee($link);
    } else {
    $my_tree .= $interface;
    }
    }

    // comma puts condition:
    if ($i && $i != count($implements) - 1) $my_tree .= ', ';

    So $i should be greater than 0 and not the last. And this is mistake
    because comma puts BEFORE interface. To fix this bug (not tested) just
    remove second condition.

    // comma puts fixed condition:
    if ($i > 0) $my_tree .= ', ';


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-10-12 21:40:49] ashnazg

    -Assigned To:
    +Assigned To: ashnazg
    Tried to verify this behavior using v1.4.3 against PHP 5.3.8 and 5.2.17,
    but tests are being affected by interface names failing to appear in the
    place where the commas are expected. Presumably this is due to some
    combination of bug 18870 and bug 18871, and the bug reporter likely
    discovered this bug when patching his code for the other two bugs. I'll
    have to get the other two bugs patched and tested before verifying this
    bug behavior, I think.

    As an aside, the issue is irrelevant when using PHP 4.4.9.

    ------------------------------------------------------------------------

    [2011-10-07 21:11:36] ashnazg

    -Roadmap Versions:
    +Roadmap Versions: 1.4.4


    ------------------------------------------------------------------------

    [2011-09-25 10:01:03] drunkenstranger

    This patch works only for HTML:frames converter (you can fix another
    manually - just replace original getRootTree method).

    Also this patch fixes:
    http://pear.php.net/bugs/bug.php?id=18870
    http://pear.php.net/bugs/bug.php?id=18871

    ------------------------------------------------------------------------

    [2011-09-25 09:58:49] drunkenstranger

    Added #patch bug:18872;patch:classtree-fix.patch;revision:1316941129;.

    ------------------------------------------------------------------------

    [2011-09-25 09:38:10] drunkenstranger

    Description:
    ------------
    Class tree puts comma uncorrectly in interfaces list.

    Test script:
    ---------------
    <?php
    /** Test file for MyPackage2 class tree
    * @package MyPackage */

    /** @package MyPackage */
    interface MyInterface {}

    /** @package MyPackage */
    interface MyInterface2 {}

    /** @package MyPackage */
    interface MyInterface3 {}

    /** @package MyPackage */
    class MyClass implements MyInterface, MyInterface2, MyInterface3 {}


    /** @package MyPackage */
    class MyClass2 extends MyClass {}

    ?>

    Expected result:
    ----------------
    Root class MyClass

    MyClass (implements MyInterface, MyInterface2, MyInterface3)
    MyClass2


    Actual result:
    --------------
    Root class MyClass

    MyClass (implements MyInterface, MyInterface2MyInterface3)
    MyClass2

    ------------------------------------------------------------------------
  • Drunkenstranger at Oct 13, 2011 at 10:43 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18872&edit=1

    ID: 18872
    Comment by: drunkenstranger@gmail.com
    Reported By: drunkenstranger at gmail dot com
    Summary: Class tree puts comma uncorrectly in interfaces list
    Status: Assigned
    Type: Bug
    Package: PhpDocumentor
    Operating System: Windows XP
    Package Version: SVN
    PHP Version: 5.2.12
    Assigned To: ashnazg
    Roadmap Versions:
    New Comment:

    Or maybe we had $implements arrays with different keys?


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-10-13 12:42:51] drunkenstranger

    Nope, this tested with clear SVN trunk head revision (changed only
    "phpdoc" & "phpdoc.bat"). But only with HTML:frames:default converter.
    Review this with 318072 revision - the same result.

    /*

    https://svn.php.net/repository/pear/packages/PhpDocumentor/trunk/phpDocumentor/Converters/HTML/frames/HTMLframesConverter.inc:318062
    lines:1361-1368
    */
    foreach ($implements as $i => $interface) {
    if ($i && $i != count($implements) - 1) $my_tree .= ', ';
    if ($link = $this->getLink('object ' . $interface)) {
    $my_tree .= $this->returnSee($link);
    } else {
    $my_tree .= $interface;
    }
    }

    // comma puts condition:
    if ($i && $i != count($implements) - 1) $my_tree .= ', ';

    So $i should be greater than 0 and not the last. And this is mistake
    because comma puts BEFORE interface. To fix this bug (not tested) just
    remove second condition.

    // comma puts fixed condition:
    if ($i > 0) $my_tree .= ', ';

    ------------------------------------------------------------------------

    [2011-10-12 21:40:49] ashnazg

    -Assigned To:
    +Assigned To: ashnazg
    Tried to verify this behavior using v1.4.3 against PHP 5.3.8 and 5.2.17,
    but tests are being affected by interface names failing to appear in the
    place where the commas are expected. Presumably this is due to some
    combination of bug 18870 and bug 18871, and the bug reporter likely
    discovered this bug when patching his code for the other two bugs. I'll
    have to get the other two bugs patched and tested before verifying this
    bug behavior, I think.

    As an aside, the issue is irrelevant when using PHP 4.4.9.

    ------------------------------------------------------------------------

    [2011-10-07 21:11:36] ashnazg

    -Roadmap Versions:
    +Roadmap Versions: 1.4.4


    ------------------------------------------------------------------------

    [2011-09-25 10:01:03] drunkenstranger

    This patch works only for HTML:frames converter (you can fix another
    manually - just replace original getRootTree method).

    Also this patch fixes:
    http://pear.php.net/bugs/bug.php?id=18870
    http://pear.php.net/bugs/bug.php?id=18871

    ------------------------------------------------------------------------

    [2011-09-25 09:58:49] drunkenstranger

    Added #patch bug:18872;patch:classtree-fix.patch;revision:1316941129;.

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=18872
  • Demon Gene at Oct 14, 2011 at 3:20 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18872&edit=1

    ID: 18872
    Updated by: demon.gene@gmail.com
    Reported By: drunkenstranger at gmail dot com
    Summary: Class tree puts comma uncorrectly in interfaces list
    -Status: Assigned
    +Status: Closed
    Type: Bug
    Package: PhpDocumentor
    Operating System: Windows XP
    Package Version: SVN
    PHP Version: 5.2.12
    Assigned To: ashnazg
    Roadmap Versions:
    New Comment:

    -Status: Assigned
    +Status: Closed
    Followed the concept of the provided patch to pull interface handling
    outside of the child class handling logic. Tests good on PHP 5.3.8,
    5.2.17, and 4.4.9 to solve the interface listing issues in the class
    list view. Committed to SVN.


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-10-13 12:45:14] drunkenstranger

    Or maybe we had $implements arrays with different keys?

    ------------------------------------------------------------------------

    [2011-10-13 12:42:51] drunkenstranger

    Nope, this tested with clear SVN trunk head revision (changed only
    "phpdoc" & "phpdoc.bat"). But only with HTML:frames:default converter.
    Review this with 318072 revision - the same result.

    /*

    https://svn.php.net/repository/pear/packages/PhpDocumentor/trunk/phpDocumentor/Converters/HTML/frames/HTMLframesConverter.inc:318062
    lines:1361-1368
    */
    foreach ($implements as $i => $interface) {
    if ($i && $i != count($implements) - 1) $my_tree .= ', ';
    if ($link = $this->getLink('object ' . $interface)) {
    $my_tree .= $this->returnSee($link);
    } else {
    $my_tree .= $interface;
    }
    }

    // comma puts condition:
    if ($i && $i != count($implements) - 1) $my_tree .= ', ';

    So $i should be greater than 0 and not the last. And this is mistake
    because comma puts BEFORE interface. To fix this bug (not tested) just
    remove second condition.

    // comma puts fixed condition:
    if ($i > 0) $my_tree .= ', ';

    ------------------------------------------------------------------------

    [2011-10-12 21:40:49] ashnazg

    -Assigned To:
    +Assigned To: ashnazg
    Tried to verify this behavior using v1.4.3 against PHP 5.3.8 and 5.2.17,
    but tests are being affected by interface names failing to appear in the
    place where the commas are expected. Presumably this is due to some
    combination of bug 18870 and bug 18871, and the bug reporter likely
    discovered this bug when patching his code for the other two bugs. I'll
    have to get the other two bugs patched and tested before verifying this
    bug behavior, I think.

    As an aside, the issue is irrelevant when using PHP 4.4.9.

    ------------------------------------------------------------------------

    [2011-10-07 21:11:36] ashnazg

    -Roadmap Versions:
    +Roadmap Versions: 1.4.4


    ------------------------------------------------------------------------

    [2011-09-25 10:01:03] drunkenstranger

    This patch works only for HTML:frames converter (you can fix another
    manually - just replace original getRootTree method).

    Also this patch fixes:
    http://pear.php.net/bugs/bug.php?id=18870
    http://pear.php.net/bugs/bug.php?id=18871

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=18872

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedOct 7, '11 at 7:10p
activeOct 14, '11 at 3:20a
posts5
users2
websitepear.php.net

2 users in discussion

Demon Gene: 3 posts Drunkenstranger: 2 posts

People

Translate

site design / logo © 2022 Grokbase