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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!