Edit report at http://pear.php.net/bugs/bug.php?id=17807&edit=1
ID: 17807
Updated by: demon.gene@gmail.com
Reported By: matt at abstractvector dot co dot uk
Summary: Erroneous message "duplicate class element" when
using static keyword
Status: Verified
-Type: Bug
+Type: Feature/Change Request
Package: PhpDocumentor
Operating System: Ubuntu 10.04 64-bit
Package Version: 1.4.3
PHP Version: 5.3.2
-Roadmap Versions:
+Roadmap Versions: 1.5.0a1
New Comment:
-Type: Bug
+Type: Feature/Change Request
-Roadmap Versions:
+Roadmap Versions: 1.5.0a1
Just realized that this issue is due to "static::" being new with PHP
5.3. So, this prompts a decision, similar to the new "namespace"
keyword: add new functionality to handle the new keyword, or not?
Either way, this does become new functionality. Switching this Bug to a
new Request.
Previous Comments:
------------------------------------------------------------------------
[2011-10-14 23:02:35] ashnazg
Discovered today that a class method that comes after the "bad" one ends
up being documented as a standalone function, outside of the class...
------------------------------------------------------------------------
[2011-09-24 07:30:22] ashnazg
-Status: Open
+Status: Verified
Verified the reported behavior on phpDocumentor SVN, using PHPs 5.3.8,
5.2.17, and 4.4.9.
------------------------------------------------------------------------
[2010-08-24 13:19:18] mattk4k
Description:
------------
When using the static keyword to access class properties, phpDocumentor
throws an error.
Test script:
---------------
<?php
/**
* Page-level docblock
*
* @package Test
*/
/**
* Class-level docblock
* @package Test
*/
class Test
{
/**
* Example function
*
* @param string $bar Text
*
* @return void
*/
public static function bar($bar) {
if (null === static::$foo) { static::$foo = array(); }
if (!isset(static::$foo[$bar])) { } // Remove this line and all is
good
}
}
Expected result:
----------------
I expect the above to parse fine and continue reading the class
Actual result:
--------------
The following error messages appear:
WARNING in Test.php on line 24: Class "Test" has no Class-level
DocBlock.
WARNING in Test.php on line 24: no @package tag was used in a DocBlock
for class Test
WARNING in Test.php on line 24:
duplicate class element "Test" in file /home/matt/Test/Test.php will be
ignored.
Use an @ignore tag on the original if you want this case to be
documented.
In addition, subsequent methods in the class are ignored.
------------------------------------------------------------------------