From b3350a0ea72913b5a771c880e32d8b7232f82861 Mon Sep 17 00:00:00 2001 From: Meirza Date: Mon, 8 May 2023 09:51:29 +0700 Subject: [PATCH] MDL-78145 lib: Added missing class properties in pear In PHP 8.2 and later, setting a value to an undeclared class property is deprecated and emits a deprecation notice. So we need to add missing class properties that still need to be declared. --- lib/pear/HTML/QuickForm/Renderer/Array.php | 3 +-- lib/pear/HTML/QuickForm/Renderer/Object.php | 1 - lib/pear/PEAR.php | 3 +++ lib/pear/readme_moodle.txt | 3 +++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/pear/HTML/QuickForm/Renderer/Array.php b/lib/pear/HTML/QuickForm/Renderer/Array.php index a91d90b7eed..36dd2cefc01 100644 --- a/lib/pear/HTML/QuickForm/Renderer/Array.php +++ b/lib/pear/HTML/QuickForm/Renderer/Array.php @@ -138,7 +138,7 @@ class HTML_QuickForm_Renderer_Array extends HTML_QuickForm_Renderer * false: leave labels as defined * @var bool */ - var $staticLabels = false; + var $_staticLabels = false; /** * Constructor @@ -187,7 +187,6 @@ class HTML_QuickForm_Renderer_Array extends HTML_QuickForm_Renderer if ($this->_collectHidden) { $this->_ary['hidden'] = ''; } - $this->_elementIdx = 1; $this->_currentSection = null; $this->_sectionCount = 0; } // end func startForm diff --git a/lib/pear/HTML/QuickForm/Renderer/Object.php b/lib/pear/HTML/QuickForm/Renderer/Object.php index 9928a0b3d58..b4eade768ef 100644 --- a/lib/pear/HTML/QuickForm/Renderer/Object.php +++ b/lib/pear/HTML/QuickForm/Renderer/Object.php @@ -124,7 +124,6 @@ class HTML_QuickForm_Renderer_Object extends HTML_QuickForm_Renderer if($this->_collectHidden) { $this->_obj->hidden = ''; } - $this->_elementIdx = 1; $this->_currentSection = null; $this->_sectionCount = 0; } // end func startForm diff --git a/lib/pear/PEAR.php b/lib/pear/PEAR.php index 295bb1e18c4..73909cd4404 100644 --- a/lib/pear/PEAR.php +++ b/lib/pear/PEAR.php @@ -815,6 +815,9 @@ class PEAR_Error var $userinfo = ''; var $backtrace = null; + /** @var mixed error level. */ + private $callback; + /** * PEAR_Error constructor * diff --git a/lib/pear/readme_moodle.txt b/lib/pear/readme_moodle.txt index 556c32f803b..b585c1357e5 100644 --- a/lib/pear/readme_moodle.txt +++ b/lib/pear/readme_moodle.txt @@ -35,6 +35,9 @@ MDL-71126 - Quiz: Manual grading page size preference can get stuck at 0 MDL-76102 / MDL-77081 PHP 8.1 passing null to a non-nullable argument of a built-in function is deprecated MDL-77164 - PHPdocs corrections +MDL-78145 - PHP 8.2 compliance. Added a missing class property that still need to be declared + to avoid dynamic properties deprecated error warning. + And also remove the $_elementIdx because it is not needed in Moodle code. Pear ====