From d28eb51ddc3b5c6d1df0ddc6bf83adb62b28bbb0 Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Mon, 2 Oct 2017 09:16:49 +0800 Subject: [PATCH] MDL-60281 general: remove class object() completely This class was deprecated under MDL-52471 and was showing debugging notice from Moodle 3.0.1 In PHP7.2 the class declaration fails with fatal error even if it's not used anywhere --- lib/setuplib.php | 21 --------------------- lib/tests/setuplib_test.php | 6 ------ 2 files changed, 27 deletions(-) diff --git a/lib/setuplib.php b/lib/setuplib.php index 3532c7bf69f..7f6191ae576 100644 --- a/lib/setuplib.php +++ b/lib/setuplib.php @@ -51,27 +51,6 @@ define('MEMORY_EXTRA', -3); /** Extremely large memory limit - not recommended for standard scripts */ define('MEMORY_HUGE', -4); - -/** - * Simple class. It is usually used instead of stdClass because it looks - * more familiar to Java developers ;-) Do not use for type checking of - * function parameters. Please use stdClass instead. - * - * @package core - * @subpackage lib - * @copyright 2009 Petr Skoda {@link http://skodak.org} - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @deprecated since 2.0 - */ -class object extends stdClass { - /** - * Constructor. - */ - public function __construct() { - debugging("'object' class has been deprecated, please use stdClass instead.", DEBUG_DEVELOPER); - } -}; - /** * Base Moodle Exception class * diff --git a/lib/tests/setuplib_test.php b/lib/tests/setuplib_test.php index 357a6d7bae8..e801a14fc7d 100644 --- a/lib/tests/setuplib_test.php +++ b/lib/tests/setuplib_test.php @@ -469,12 +469,6 @@ class core_setuplib_testcase extends advanced_testcase { } } - public function test_object() { - $obj = new object(); - $this->assertDebuggingCalled("'object' class has been deprecated, please use stdClass instead."); - $this->assertInstanceOf('stdClass', $obj); - } - /** * Data provider for test_get_real_size(). *