PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Tools and Utilities » PhpDocumentor » Bug #6850

Fatal error in phpDocumentorTParser.inc on line 480

Details

Submitted2006-02-21 11:10 UTC
Fromtacker at php dot net
Assignedtacker
StatusClosed
PackagePhpDocumentor
PHP Version5.1.1
OSLinux
Roadmaps(Not assigned)

Comments

[2006-02-21 11:10 UTC] tacker at php dot net

Description:
------------
PHP Version 5.1.1-gentoo
phpDocumentor version 1.3.0RC5

Parsing configuration file phpDocumentor.ini...
done
using tokenizer Parser

Fatal error: Call to undefined method parserFunction::setModifiers() in /usr/share/php/PhpDocumentor/phpDocumentor/phpDocumentorTParser.inc on line 480

[2006-02-21 16:05 UTC] jeichorn at php dot net

An error like this is dependant on the code its parsing, any chance you can put a test case up somewhere

[2006-02-21 16:25 UTC] tacker at php dot net

Phew, it's a large project. Any hint on what section of the code this might happen?

[2006-02-21 16:30 UTC] jeichorn at php dot net

No clue, but you add edit your phpDocumentor.ini (in the pear data dir) you can turn the debug mode on which should at least get you to a specific file.

[2006-02-21 17:28 UTC] tacker at php dot net

Ok, this is the test case.

If you comment out the body of get() or &getUsers() it works.

<?php

/**
* MyClass.php
*
* @author Markus Tacker <mtacker@itfuture.de>
* @copyright 2005 IT Future AG | http://www.itfuture.de
* @package MyPackage
*/

/**
* MyClass class
*
* @author Markus Tacker <mtacker@itfuture.de>
* @copyright 2005 IT Future AG | http://www.itfuture.de
* @package MyPackage
*/
abstract class MyClass
{
/**
* Factory by parameters
*
* @param string type
* @param array Additional parameters
*/
final public static function get($name, Array $params)
{
$class_name = __CLASS__ . '_' . ucfirst(strtolower($name));
}

/**
* Returns the list of users
*
* @return array
*/
abstract public function &getUsers();
}

?>

ini I used:

[Parse Data]
title = Test
hidden = false
parseprivate = off
javadocdesc = off
defaultpackagename = MyProject
defaultcategoryname = MyProject
target = ./doc
filename = pear-bug-6850.php
output=HTML:frames:DOM/earthli

[2006-02-22 10:31 UTC] tacker at php dot net

> could you try with the Array typehint removed?
This made phpdoc run. But I wouldn't consider this a fix or an acceptable workaround.

So, basicially this bug is a dupe of Bug #6305.

[2006-04-30 17:19 UTC] gnarea at gmail dot com

Hi.

I have the same problem and before the E_ERROR is produced, phpdocu outputs this message:

WARNING in Record.php on line 745: no @package tag was used in a DocBlock for class DB_Record
WARNING in Record.php on line 745:
duplicate class element "DB_Record" in file /home/gustavo/Projeti/PEAR/DB_Record/Record.php will be ignored.
Use an @ignore tag on the original if you want this case to be documented.

However, my DB_Record class does define the @package tag on line 29 and line 745 is a single-line comment (not a docblock). In addition, line 745 corresponds to the register() method of my class, which is unique in the class and does not use any typehint.

I'm using PHP5.0.4 and phpDocumentor 1.3.0RC5.

Cheers!

PS: According to your documentation API <http://manual.phpdoc.org/HTMLSmartyConverter/PHP/phpDocumentor/ParserElements/parserFunction.html>, the setModifiers() method does not exist; it is not even defined by a parent class.

[2006-04-30 17:43 UTC] gnarea at gmail dot com

BTW, this is the callstack:

Call Stack:
0.0085 1. {main}() /usr/local/php5/bin/phpdoc:0
0.0094 2. include() /usr/local/php5/bin/phpdoc:37
0.3905 3. phpDocumentor_setup->createDocs() /usr/local/php5/lib/php/PhpDocumentor/phpDocumentor/phpdoc.inc:44
11.7405 4. phpDocumentorTParser->parse() /usr/local/php5/lib/php/PhpDocumentor/phpDocumentor/Setup.inc.php:646
19.1654 5. phpDocumentorTParser->handleFunction() /usr/local/php5/lib/php/PhpDocumentor/phpDocumentor/phpDocumentorTParser.inc:279

[2006-04-30 18:19 UTC] gnarea at gmail dot com

Oops... I'm sorry, I got that error because I made a systax error...

Anyway, It'd be interesting to know why it calls an undefined method...