dealfonso / sapp

Simple and Agnostic PDF Document Parser in PHP - sign PDF docs using PHP
GNU Lesser General Public License v3.0
110 stars 29 forks source link

Fix Call to a member function get_keys on bool #42

Closed erikn69 closed 1 year ago

erikn69 commented 1 year ago

Maybe this is a bug, I'm getting

PHP Fatal error:  Uncaught Error: Call to a member function get_keys() on bool in PDFObject.php:76

It is because $_value on PDFObject is not always an instance of PDFValue https://github.com/dealfonso/sapp/blob/61960ae449be7b86d47a625bab625b26db8e6ee3/src/pdfvalue/PDFValue.php#L67-L69

Is there a better solution?

dealfonso commented 1 year ago

Hi,

it is important to identify the context in which the error appears. Could you provide an example? Maybe the class is not used as it should be... a similar problem happened to me when I added support for rotated pages: I used scalar values when I should have used classes.

erikn69 commented 1 year ago

https://github.com/dealfonso/sapp/pull/40 was the context

dealfonso commented 1 year ago

sorry, but maybe the object is not properly used.