From 3a673213fb1e8dc2a25727824731daacbb8a974a Mon Sep 17 00:00:00 2001 From: raortegar Date: Mon, 13 Feb 2023 10:36:46 +0100 Subject: [PATCH] MDL-76413 lib: Fixed PHP 8.2 callable deprecations in evalmath --- lib/evalmath/evalmath.class.php | 2 +- lib/evalmath/readme_moodle.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/evalmath/evalmath.class.php b/lib/evalmath/evalmath.class.php index 7e1a8790b30..54bba6b3c62 100644 --- a/lib/evalmath/evalmath.class.php +++ b/lib/evalmath/evalmath.class.php @@ -557,7 +557,7 @@ class EvalMathFuncs { static function average() { $args = func_get_args(); - return (call_user_func_array(array('self', 'sum'), $args) / count($args)); + return (call_user_func_array(array(self::class, 'sum'), $args) / count($args)); } static function max() { diff --git a/lib/evalmath/readme_moodle.txt b/lib/evalmath/readme_moodle.txt index b40f83b79f0..3d460eb9986 100644 --- a/lib/evalmath/readme_moodle.txt +++ b/lib/evalmath/readme_moodle.txt @@ -29,3 +29,7 @@ Changes by Stefan Erlachner, Thomas Niedermaier (MDL-64414): e.g. if (or(condition_1, condition_2, ... condition_n)) * add function and: e.g. if (and(condition_1, condition_2, ... condition_n)) + +Changes by Raquel Ortega (MDL-76413) +* Avoid PHP 8.2: Partially-supported callable deprecations +* eg: call_user_func_array(array('self', 'sum'), $args to call_user_func_array(array(self::class, 'sum'), $args) \ No newline at end of file