Fixed regression from fixing PHP 8.2 deprecated usages earlier, which… #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… broke rendering certain elements in a pdf in Magento
This fixes a regression bug that was created in #1
The bug is described here: magento/magento2#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)