From c196b1a85998dcadc4cb95dab63675fa0a7c0396 Mon Sep 17 00:00:00 2001 From: Pieter Hoste Date: Mon, 22 May 2023 15:58:01 +0200 Subject: [PATCH] Fixed PHP 8.2 deprecation warnings: 'creation of dynamic property'. --- library/Zend/Pdf.php | 8 +++- library/Zend/Pdf/Action.php | 2 +- library/Zend/Pdf/Canvas.php | 2 +- library/Zend/Pdf/Canvas/Abstract.php | 7 +++ library/Zend/Pdf/Element.php | 7 +++ library/Zend/Pdf/Element/Boolean.php | 8 ---- library/Zend/Pdf/Element/Name.php | 8 ---- library/Zend/Pdf/Element/Null.php | 8 ---- library/Zend/Pdf/Element/Numeric.php | 8 ---- library/Zend/Pdf/Element/Stream.php | 8 ---- library/Zend/Pdf/Element/String.php | 7 --- library/Zend/Pdf/Outline.php | 43 ++++++++++++++++++ library/Zend/Pdf/Outline/Created.php | 44 ------------------- library/Zend/Pdf/Page.php | 7 --- library/Zend/Pdf/Resource/Font/CidFont.php | 3 +- .../Zend/Pdf/Resource/Font/Simple/Parsed.php | 2 +- .../Resource/Font/Simple/Standard/Courier.php | 2 +- .../Font/Simple/Standard/CourierBold.php | 2 +- .../Simple/Standard/CourierBoldOblique.php | 2 +- .../Font/Simple/Standard/CourierOblique.php | 2 +- .../Font/Simple/Standard/Helvetica.php | 2 +- .../Font/Simple/Standard/HelveticaBold.php | 2 +- .../Simple/Standard/HelveticaBoldOblique.php | 2 +- .../Font/Simple/Standard/HelveticaOblique.php | 2 +- .../Resource/Font/Simple/Standard/Symbol.php | 2 +- .../Font/Simple/Standard/TimesBold.php | 2 +- .../Font/Simple/Standard/TimesBoldItalic.php | 2 +- .../Font/Simple/Standard/TimesItalic.php | 2 +- .../Font/Simple/Standard/TimesRoman.php | 2 +- .../Font/Simple/Standard/ZapfDingbats.php | 2 +- library/Zend/Pdf/Resource/Font/Type0.php | 3 +- 31 files changed, 83 insertions(+), 120 deletions(-) diff --git a/library/Zend/Pdf.php b/library/Zend/Pdf.php index 0eebb51..9d82539 100644 --- a/library/Zend/Pdf.php +++ b/library/Zend/Pdf.php @@ -81,7 +81,6 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -#[\AllowDynamicProperties] class Zend_Pdf { /**** Class Constants ****/ @@ -207,6 +206,13 @@ class Zend_Pdf */ protected $_parser; + /** + * PDF version specified in the file header + * + * @var string + */ + protected $_pdfHeaderVersion; + /** * List of inheritable attributesfor pages tree * diff --git a/library/Zend/Pdf/Action.php b/library/Zend/Pdf/Action.php index 134deba..ee0f832 100644 --- a/library/Zend/Pdf/Action.php +++ b/library/Zend/Pdf/Action.php @@ -407,6 +407,6 @@ public function hasChildren() #[\ReturnTypeWillChange] public function count() { - return count($this->childOutlines); + return count($this->next); } } diff --git a/library/Zend/Pdf/Canvas.php b/library/Zend/Pdf/Canvas.php index 3cc8e7d..8f2e283 100644 --- a/library/Zend/Pdf/Canvas.php +++ b/library/Zend/Pdf/Canvas.php @@ -77,7 +77,7 @@ public function __construct($width, $height) */ protected function _addProcSet($procSetName) { - $this->_procset[$procSetName] = 1; + $this->_procSet[$procSetName] = 1; } /** diff --git a/library/Zend/Pdf/Canvas/Abstract.php b/library/Zend/Pdf/Canvas/Abstract.php index 6eef212..fb61e1b 100644 --- a/library/Zend/Pdf/Canvas/Abstract.php +++ b/library/Zend/Pdf/Canvas/Abstract.php @@ -74,6 +74,13 @@ abstract class Zend_Pdf_Canvas_Abstract implements Zend_Pdf_Canvas_Interface */ protected $_style = null; + /** + * Page dictionary (refers to an inderect Zend_Pdf_Element_Dictionary object). + * + * @var Zend_Pdf_Element_Reference|Zend_Pdf_Element_Object + */ + protected $_dictionary; + /** * Counter for the "Save" operations diff --git a/library/Zend/Pdf/Element.php b/library/Zend/Pdf/Element.php index ca8f83e..1a92dea 100644 --- a/library/Zend/Pdf/Element.php +++ b/library/Zend/Pdf/Element.php @@ -45,6 +45,13 @@ abstract class Zend_Pdf_Element */ private $_parentObject = null; + /** + * Object value + * + * @var string + */ + public $value; + /** * Return type of the element. * See ZPdfPDFConst for possible values diff --git a/library/Zend/Pdf/Element/Boolean.php b/library/Zend/Pdf/Element/Boolean.php index 954838e..b0edd67 100644 --- a/library/Zend/Pdf/Element/Boolean.php +++ b/library/Zend/Pdf/Element/Boolean.php @@ -34,14 +34,6 @@ */ class Zend_Pdf_Element_Boolean extends Zend_Pdf_Element { - /** - * Object value - * - * @var boolean - */ - public $value; - - /** * Object constructor * diff --git a/library/Zend/Pdf/Element/Name.php b/library/Zend/Pdf/Element/Name.php index 4983657..de08f39 100644 --- a/library/Zend/Pdf/Element/Name.php +++ b/library/Zend/Pdf/Element/Name.php @@ -34,14 +34,6 @@ */ class Zend_Pdf_Element_Name extends Zend_Pdf_Element { - /** - * Object value - * - * @var string - */ - public $value; - - /** * Object constructor * diff --git a/library/Zend/Pdf/Element/Null.php b/library/Zend/Pdf/Element/Null.php index e535257..d2b435a 100644 --- a/library/Zend/Pdf/Element/Null.php +++ b/library/Zend/Pdf/Element/Null.php @@ -34,14 +34,6 @@ */ class Zend_Pdf_Element_Null extends Zend_Pdf_Element { - /** - * Object value. Always null. - * - * @var mixed - */ - public $value; - - /** * Object constructor */ diff --git a/library/Zend/Pdf/Element/Numeric.php b/library/Zend/Pdf/Element/Numeric.php index 6d146bc..e039421 100644 --- a/library/Zend/Pdf/Element/Numeric.php +++ b/library/Zend/Pdf/Element/Numeric.php @@ -34,14 +34,6 @@ */ class Zend_Pdf_Element_Numeric extends Zend_Pdf_Element { - /** - * Object value - * - * @var numeric - */ - public $value; - - /** * Object constructor * diff --git a/library/Zend/Pdf/Element/Stream.php b/library/Zend/Pdf/Element/Stream.php index 0580e2c..37b88dc 100644 --- a/library/Zend/Pdf/Element/Stream.php +++ b/library/Zend/Pdf/Element/Stream.php @@ -37,14 +37,6 @@ */ class Zend_Pdf_Element_Stream extends Zend_Pdf_Element { - /** - * Object value - * - * @var Zend_Memory_Container - */ - public $value; - - /** * Object constructor * diff --git a/library/Zend/Pdf/Element/String.php b/library/Zend/Pdf/Element/String.php index 507dc36..5a1a88c 100644 --- a/library/Zend/Pdf/Element/String.php +++ b/library/Zend/Pdf/Element/String.php @@ -33,13 +33,6 @@ */ class Zend_Pdf_Element_String extends Zend_Pdf_Element { - /** - * Object value - * - * @var string - */ - public $value; - /** * Object constructor * diff --git a/library/Zend/Pdf/Outline.php b/library/Zend/Pdf/Outline.php index a2d304e..b10512b 100644 --- a/library/Zend/Pdf/Outline.php +++ b/library/Zend/Pdf/Outline.php @@ -40,6 +40,49 @@ abstract class Zend_Pdf_Outline implements RecursiveIterator, Countable */ protected $_open = false; + /** + * Outline title. + * + * @var string + */ + protected $_title; + + /** + * True if outline item is displayed in italic. + * Default value is false. + * + * @var boolean + */ + protected $_italic = false; + + /** + * Color to be used for the outline entry’s text. + + * It uses the DeviceRGB color space for color representation. + * Null means default value - black ([0.0 0.0 0.0] in RGB representation). + * + * @var Zend_Pdf_Color_Rgb + */ + protected $_color = null; + + /** + * True if outline item is displayed in bold. + * Default value is false. + * + * @var boolean + */ + protected $_bold = false; + + /** + * Target destination or action. + * String means named destination + * + * Null means no target. + * + * @var Zend_Pdf_Destination|Zend_Pdf_Action + */ + protected $_target = null; + /** * Array of child outlines (array of Zend_Pdf_Outline objects) * diff --git a/library/Zend/Pdf/Outline/Created.php b/library/Zend/Pdf/Outline/Created.php index 1e2dfc3..86f20d2 100644 --- a/library/Zend/Pdf/Outline/Created.php +++ b/library/Zend/Pdf/Outline/Created.php @@ -43,50 +43,6 @@ */ class Zend_Pdf_Outline_Created extends Zend_Pdf_Outline { - /** - * Outline title. - * - * @var string - */ - protected $_title; - - /** - * Color to be used for the outline entry’s text. - - * It uses the DeviceRGB color space for color representation. - * Null means default value - black ([0.0 0.0 0.0] in RGB representation). - * - * @var Zend_Pdf_Color_Rgb - */ - protected $_color = null; - - /** - * True if outline item is displayed in italic. - * Default value is false. - * - * @var boolean - */ - protected $_italic = false; - - /** - * True if outline item is displayed in bold. - * Default value is false. - * - * @var boolean - */ - protected $_bold = false; - - /** - * Target destination or action. - * String means named destination - * - * Null means no target. - * - * @var Zend_Pdf_Destination|Zend_Pdf_Action - */ - protected $_target = null; - - /** * Get outline title. * diff --git a/library/Zend/Pdf/Page.php b/library/Zend/Pdf/Page.php index 1f8d49a..f50743c 100644 --- a/library/Zend/Pdf/Page.php +++ b/library/Zend/Pdf/Page.php @@ -109,13 +109,6 @@ class Zend_Pdf_Page extends Zend_Pdf_Canvas_Abstract - /** - * Page dictionary (refers to an inderect Zend_Pdf_Element_Dictionary object). - * - * @var Zend_Pdf_Element_Reference|Zend_Pdf_Element_Object - */ - protected $_dictionary; - /** * PDF objects factory. * diff --git a/library/Zend/Pdf/Resource/Font/CidFont.php b/library/Zend/Pdf/Resource/Font/CidFont.php index 11ce93b..a0fd1e0 100644 --- a/library/Zend/Pdf/Resource/Font/CidFont.php +++ b/library/Zend/Pdf/Resource/Font/CidFont.php @@ -54,7 +54,6 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -#[\AllowDynamicProperties] abstract class Zend_Pdf_Resource_Font_CidFont extends Zend_Pdf_Resource_Font { /** @@ -99,7 +98,7 @@ public function __construct(Zend_Pdf_FileParser_Font_OpenType $fontParser) $this->_isBold = $fontParser->isBold; $this->_isItalic = $fontParser->isItalic; - $this->_isMonospaced = $fontParser->isMonospaced; + $this->_isMonospace = $fontParser->isMonospaced; $this->_underlinePosition = $fontParser->underlinePosition; $this->_underlineThickness = $fontParser->underlineThickness; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Parsed.php b/library/Zend/Pdf/Resource/Font/Simple/Parsed.php index 2064a21..8c570d3 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Parsed.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Parsed.php @@ -61,7 +61,7 @@ public function __construct(Zend_Pdf_FileParser_Font_OpenType $fontParser) $this->_isBold = $fontParser->isBold; $this->_isItalic = $fontParser->isItalic; - $this->_isMonospaced = $fontParser->isMonospaced; + $this->_isMonospace = $fontParser->isMonospaced; $this->_underlinePosition = $fontParser->underlinePosition; $this->_underlineThickness = $fontParser->underlineThickness; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/Courier.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/Courier.php index 57b3215..5ec7ff3 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/Courier.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/Courier.php @@ -97,7 +97,7 @@ public function __construct() $this->_isBold = false; $this->_isItalic = false; - $this->_isMonospaced = true; + $this->_isMonospace = true; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/CourierBold.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/CourierBold.php index b57c26c..677517b 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/CourierBold.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/CourierBold.php @@ -98,7 +98,7 @@ public function __construct() $this->_isBold = true; $this->_isItalic = false; - $this->_isMonospaced = true; + $this->_isMonospace = true; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/CourierBoldOblique.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/CourierBoldOblique.php index bc47d5a..937767c 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/CourierBoldOblique.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/CourierBoldOblique.php @@ -99,7 +99,7 @@ public function __construct() $this->_isBold = true; $this->_isItalic = true; - $this->_isMonospaced = true; + $this->_isMonospace = true; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/CourierOblique.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/CourierOblique.php index 499ce30..55ddd42 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/CourierOblique.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/CourierOblique.php @@ -99,7 +99,7 @@ public function __construct() $this->_isBold = false; $this->_isItalic = true; - $this->_isMonospaced = true; + $this->_isMonospace = true; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/Helvetica.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/Helvetica.php index 627d069..f5def01 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/Helvetica.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/Helvetica.php @@ -107,7 +107,7 @@ public function __construct() $this->_isBold = false; $this->_isItalic = false; - $this->_isMonospaced = false; + $this->_isMonospace = false; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/HelveticaBold.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/HelveticaBold.php index 2bc235e..4226c36 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/HelveticaBold.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/HelveticaBold.php @@ -107,7 +107,7 @@ public function __construct() $this->_isBold = true; $this->_isItalic = false; - $this->_isMonospaced = false; + $this->_isMonospace = false; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/HelveticaBoldOblique.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/HelveticaBoldOblique.php index 042857c..a9c2e77 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/HelveticaBoldOblique.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/HelveticaBoldOblique.php @@ -110,7 +110,7 @@ public function __construct() $this->_isBold = true; $this->_isItalic = true; - $this->_isMonospaced = false; + $this->_isMonospace = false; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/HelveticaOblique.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/HelveticaOblique.php index 9bf277e..22195af 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/HelveticaOblique.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/HelveticaOblique.php @@ -109,7 +109,7 @@ public function __construct() $this->_isBold = false; $this->_isItalic = true; - $this->_isMonospaced = false; + $this->_isMonospace = false; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/Symbol.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/Symbol.php index 557203d..29dde57 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/Symbol.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/Symbol.php @@ -227,7 +227,7 @@ public function __construct() $this->_isBold = false; $this->_isItalic = false; - $this->_isMonospaced = false; + $this->_isMonospace = false; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesBold.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesBold.php index 9fc3496..9587a97 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesBold.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesBold.php @@ -106,7 +106,7 @@ public function __construct() $this->_isBold = true; $this->_isItalic = false; - $this->_isMonospaced = false; + $this->_isMonospace = false; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesBoldItalic.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesBoldItalic.php index ed7942e..7cfa7ed 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesBoldItalic.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesBoldItalic.php @@ -107,7 +107,7 @@ public function __construct() $this->_isBold = true; $this->_isItalic = true; - $this->_isMonospaced = false; + $this->_isMonospace = false; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesItalic.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesItalic.php index 81d019d..f8d6203 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesItalic.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesItalic.php @@ -107,7 +107,7 @@ public function __construct() $this->_isBold = false; $this->_isItalic = true; - $this->_isMonospaced = false; + $this->_isMonospace = false; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesRoman.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesRoman.php index 5bbff85..279ecb0 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesRoman.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/TimesRoman.php @@ -107,7 +107,7 @@ public function __construct() $this->_isBold = false; $this->_isItalic = false; - $this->_isMonospaced = false; + $this->_isMonospace = false; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Simple/Standard/ZapfDingbats.php b/library/Zend/Pdf/Resource/Font/Simple/Standard/ZapfDingbats.php index 37b6a82..7871f88 100644 --- a/library/Zend/Pdf/Resource/Font/Simple/Standard/ZapfDingbats.php +++ b/library/Zend/Pdf/Resource/Font/Simple/Standard/ZapfDingbats.php @@ -247,7 +247,7 @@ public function __construct() $this->_isBold = false; $this->_isItalic = false; - $this->_isMonospaced = false; + $this->_isMonospace = false; $this->_underlinePosition = -100; $this->_underlineThickness = 50; diff --git a/library/Zend/Pdf/Resource/Font/Type0.php b/library/Zend/Pdf/Resource/Font/Type0.php index cbfe6f3..bae31f0 100644 --- a/library/Zend/Pdf/Resource/Font/Type0.php +++ b/library/Zend/Pdf/Resource/Font/Type0.php @@ -60,7 +60,6 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -#[\AllowDynamicProperties] class Zend_Pdf_Resource_Font_Type0 extends Zend_Pdf_Resource_Font { /** @@ -118,7 +117,7 @@ public function __construct(Zend_Pdf_Resource_Font_CidFont $descendantFont) $this->_isBold = $descendantFont->isBold(); $this->_isItalic = $descendantFont->isItalic(); - $this->_isMonospaced = $descendantFont->isMonospace(); + $this->_isMonospace = $descendantFont->isMonospace(); $this->_underlinePosition = $descendantFont->getUnderlinePosition(); $this->_underlineThickness = $descendantFont->getUnderlineThickness();