I can not really explain how it triggers, it's very weird and unexpected. But reverting the $value member back to each individual child class and removing it again from the parent Zend_Pdf_Element class fixes the problem.
In order to fix the PHP 8.2 deprecated usage of this->value in Zend_Pdf_Element, I turned the toPhp function into an abstract function which forces the classes that inherit from it to implement it, so I did that. It's a bit of duplicated code each time, but can't find a better way to solve it. At least the return types in docblocks will be more correct now for the toPhp function ...
(the double new lines in between methods is to stay consistent with the coding style of the original code)
… broke rendering certain elements in a pdf in Magento
This fixes a regression bug that was created in #1 The bug is described here: https://github.com/magento/magento2/issues/37897
I can not really explain how it triggers, it's very weird and unexpected. But reverting the
$value
member back to each individual child class and removing it again from the parentZend_Pdf_Element
class fixes the problem.In order to fix the PHP 8.2 deprecated usage of
this->value
inZend_Pdf_Element
, I turned thetoPhp
function into an abstract function which forces the classes that inherit from it to implement it, so I did that. It's a bit of duplicated code each time, but can't find a better way to solve it. At least the return types in docblocks will be more correct now for thetoPhp
function ...(the double new lines in between methods is to stay consistent with the coding style of the original code)