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

Bug #9915 PHP Notice in PDF Converter
Submitted: 2007-01-22 17:02 UTC
From: berdir at php dot net Assigned: ashnazg
Status: Closed Package: PhpDocumentor (version 1.3.1)
PHP Version: 5.1.6 OS: Linux
Roadmaps: 1.3.2    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2007-02-20 14:27 UTC
Package:
Bug Type:
Summary:
From: berdir at php dot net
New email:
PHP Version: Package Version: OS:

 

 [2007-01-22 17:02 UTC] berdir at php dot net (Sascha Grossenbacher)
Description: ------------ When creating a PDF with phpDoc I got some of these error messages: Notice: Trying to get property of non-object in /usr/share/php/PhpDocumentor/phpDocumentor/Converters/PDF/default/PDFdefaultConverter.inc on line 400 Call Stack: 0.0003 42520 1. {main}() /usr/bin/phpdoc:0 0.0009 51456 2. include('/usr/share/php/PhpDocumentor/phpDocumentor/phpdoc.inc') /usr/bin/phpdoc:37 0.7520 9436384 3. phpDocumentor_setup->createDocs() /usr/share/php/PhpDocumentor/phpDocumentor/phpdoc.inc:61 51.4230 51140528 4. phpDocumentor_IntermediateParser->Output() /usr/share/php/PhpDocumentor/phpDocumentor/Setup.inc.php:681 53.7578 52701776 5. phpDocumentor_IntermediateParser->Convert() /usr/share/php/PhpDocumentor/phpDocumentor/IntermediateParser.inc:1802 53.7578 52701776 6. Converter->walk() /usr/share/php/PhpDocumentor/phpDocumentor/IntermediateParser.inc:1589 54.8160 53710528 7. Converter->walk_everything() /usr/share/php/PhpDocumentor/phpDocumentor/Converter.inc:1842 201.3689 73667280 8. Converter->Convert() /usr/share/php/PhpDocumentor/phpDocumentor/Converter.inc:2380 201.3689 73667280 9. PDFdefaultConverter->convertMethod() /usr/share/php/PhpDocumentor/phpDocumentor/Converter.inc:3970

Comments

 [2007-02-15 18:50 UTC] ashnazg at php dot net (Chuck Burgess)
Sascha, are you able to isolate this error down to one particular file of yours that you are documenting? If so, can you use it to construct a small example file that I can use to duplicate the error?
 [2007-02-16 22:01 UTC] ashnazg at php dot net (Chuck Burgess)
Sascha, never mind... I can already duplicate this error with files I have in hand.
 [2007-02-16 22:05 UTC] ashnazg at php dot net (Chuck Burgess)
I see these notices when running current CVS HEAD (v1.3.1+) against PHP v5.2.0 and v5.1.6, but NOT when running against v4.4.4. Hmmm.
 [2007-02-16 22:58 UTC] ashnazg at php dot net (Chuck Burgess)
In my initial testing, changing line 400 in PDFDefaultConverter.inc from: if (isset($element->docblock->return)) to: if ($element->docblock->return) prevents those notices from occurring. I still need to doublecheck the generated docs to see what difference (if any) that makes in the output. Sascha, can you apply this one-line change to your PhpDocumentor install, see if it clears up the PHP Notices for you, and see if the generated PDF doc looks any different than the one the normal v1.3.1 creates?
 [2007-02-19 21:49 UTC] ashnazg at php dot net (Chuck Burgess)
That should have read "line 398" rather than "line 400"...
 [2007-02-19 21:57 UTC] ashnazg at php dot net (Chuck Burgess)
In my comparisons of the PDF output with/without that one-line change, the only difference I'm seeing is that with the change, all the functions with an implied "void" return type (i.e. no explicit return command AND no @return tag) are now successfully showing the return type, whereas without the one-line change no return type is shown in the PDF for those functions. It looks like this fix not only solves the PHP Notices, but also is necessary for the implied "void" return types to work properly with the PDF Converter. I assume that means the notices were caused by the failure of the converter to derive what the return type was supposed to be.
 [2007-02-20 14:27 UTC] ashnazg at php dot net (Chuck Burgess)
Fix ok'd by Greg, committed to CVS.
 [2007-04-03 15:32 UTC] berdir (Sascha Grossenbacher)
Sorry, I didn't get the notifications... The error seem to be gone (can't run a full test now, pdf generation takes about 20h with my PC :(). But there is a single error left when including PEAR.php (as parent class): Converting /usr/share/php/PEAR.php Procedural Page Elements... Notice: Trying to get property of non-object in /usr/share/php/PhpDocumentor/phpDocumentor/Converters/PDF/default/PDFdefaultConverter.inc on line 527 Call Stack: 0.0003 54028 1. {main}() /usr/bin/phpdoc:0 0.0008 63668 2. include('/usr/share/php/PhpDocumentor/phpDocumentor/phpdoc.inc') /usr/bin/phpdoc:37 0.3396 9844248 3. phpDocumentor_setup->createDocs() /usr/share/php/PhpDocumentor/phpDocumentor/phpdoc.inc:61 52.4330 64505960 4. phpDocumentor_IntermediateParser->Output() /usr/share/php/PhpDocumentor/phpDocumentor/Setup.inc.php:674 54.2108 66323316 5. phpDocumentor_IntermediateParser->Convert() /usr/share/php/PhpDocumentor/phpDocumentor/IntermediateParser.inc:1840 54.2109 66323316 6. Converter->walk() /usr/share/php/PhpDocumentor/phpDocumentor/IntermediateParser.inc:1627 55.0650 67545024 7. Converter->walk_everything() /usr/share/php/PhpDocumentor/phpDocumentor/Converter.inc:1842 199.5242 89080404 8. Converter->Convert() /usr/share/php/PhpDocumentor/phpDocumentor/Converter.inc:2329 199.5242 89080404 9. PDFdefaultConverter->convertFunction() /usr/share/php/PhpDocumentor/phpDocumentor/Converter.inc:3969 Seems to be something similiar, line 527 is this: $template->assign('return',$element->docblock->return->returnType);