From f09d886f1190aec91463cebf22ecbbde22d09100 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Mon, 11 Mar 2024 21:41:35 +0800 Subject: [PATCH] MDL-80677 core: deprecation::from should always return --- lib/classes/deprecation.php | 3 +++ lib/tests/deprecation_test.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/classes/deprecation.php b/lib/classes/deprecation.php index 00738d8faa3..39aae1e5214 100644 --- a/lib/classes/deprecation.php +++ b/lib/classes/deprecation.php @@ -83,6 +83,9 @@ class deprecation { // The reference is an array, but it's not an object or a class that currently exists. return null; } + + // The reference is none of the above. + return null; } /** diff --git a/lib/tests/deprecation_test.php b/lib/tests/deprecation_test.php index dc0a1721fd0..f0b50242680 100644 --- a/lib/tests/deprecation_test.php +++ b/lib/tests/deprecation_test.php @@ -285,6 +285,9 @@ class deprecation_test extends \advanced_testcase { // Deprecated global function. ['core\fixtures\deprecated_function', true], ['core\fixtures\not_deprecated_function', false], + + // Empty array. + [[], false], ]; }