MDL-69838 core: final removal of deprecated 310 methods.

This commit is contained in:
Paul Holden 2023-01-20 16:30:15 +00:00
parent 0780e87f06
commit 889f35fc26
5 changed files with 13 additions and 76 deletions

View File

@ -175,18 +175,9 @@ class mustache_helper_collection extends \Mustache_HelperCollection {
}
/**
* Parse the given string and remove any reference to disallowed helpers.
*
* @deprecated Deprecated since Moodle 3.10 (MDL-69050) - use {@see self::strip_disallowed_helpers()}
* @param string[] $disallowedlist List of helper names to strip
* @param string $string String to parse
* @return string Parsed string
* @deprecated Deprecated since Moodle 3.10 (MDL-69050) - use {@see strip_disallowed_helpers}
*/
public function strip_blacklisted_helpers($disallowedlist, $string) {
debugging('mustache_helper_collection::strip_blacklisted_helpers() is deprecated. ' .
'Please use mustache_helper_collection::strip_disallowed_helpers() instead.', DEBUG_DEVELOPER);
return $this->strip_disallowed_helpers($disallowedlist, $string);
public function strip_blacklisted_helpers() {
throw new \coding_exception('\core\output\mustache_helper_collection::strip_blacklisted_helpers() has been removed.');
}
}

View File

@ -430,23 +430,10 @@ class filetypes_util {
}
/**
* Should the given file type be considered as a part of the given list.
*
* If multiple types are provided, all of them must be part of the
* list. Empty type is part of any list. Any type is part of an
* empty list.
*
* @deprecated since Moodle 3.10 MDL-69050 - please use {@see self::is_listed()} instead.
* @param string|array $types File type or list of types to be checked.
* @param string|array $list An array or string listing the types to check against.
* @return boolean
* @deprecated since Moodle 3.10 MDL-69050 - please use {@see is_listed} instead.
*/
public function is_whitelisted($types, $list) {
debugging('filetypes_util::is_whitelisted() is deprecated. Please use filetypes_util::is_listed() instead.',
DEBUG_DEVELOPER);
return $this->is_listed($types, $list);
public function is_whitelisted() {
throw new \coding_exception('\core_form\filetypes_util::is_whitelisted() has been removed.');
}
/**
@ -476,21 +463,10 @@ class filetypes_util {
}
/**
* Returns all types that are not part of the given list.
*
* This is similar check to the {@see self::is_listed()} but this one actually returns the extra types.
*
* @deprecated since Moodle 3.10 MDL-69050 - please use {@see self::get_not_whitelisted()} instead.
* @param string|array $types File type or list of types to be checked.
* @param string|array $list An array or string listing the types to check against.
* @return array Types not present in the list.
* @deprecated since Moodle 3.10 MDL-69050 - please use {@see get_not_listed} instead.
*/
public function get_not_whitelisted($types, $list) {
debugging('filetypes_util::get_not_whitelisted() is deprecated. Please use filetypes_util::get_not_listed() instead.',
DEBUG_DEVELOPER);
return $this->get_not_listed($types, $list);
public function get_not_whitelisted() {
throw new \coding_exception('\core_form\filetypes_util::get_not_whitelisted() has been removed.');
}
/**

View File

@ -484,26 +484,4 @@ class filetypes_util_test extends advanced_testcase {
$util = new filetypes_util();
$this->assertSame($expected, $util->get_unknown_file_types($filetypes));
}
/**
* Test that a debugging noticed is displayed when calling is_whitelisted().
*/
public function test_deprecation_is_whitelisted() {
$util = new filetypes_util();
$this->assertTrue($util->is_whitelisted('txt', 'text/plain'));
$this->assertDebuggingCalled('filetypes_util::is_whitelisted() is deprecated. ' .
'Please use filetypes_util::is_listed() instead.', DEBUG_DEVELOPER);
}
/**
* Test that a debugging noticed is displayed when calling get_not_whitelisted().
*/
public function test_deprecation_get_not_whitelisted() {
$util = new filetypes_util();
$this->assertEmpty($util->get_not_whitelisted('txt', 'text/plain'));
$this->assertDebuggingCalled('filetypes_util::get_not_whitelisted() is deprecated. ' .
'Please use filetypes_util::get_not_listed() instead.', DEBUG_DEVELOPER);
}
}

View File

@ -171,16 +171,4 @@ class mustache_helper_collection_test extends \advanced_testcase {
$this->assertTrue($goodcalled);
$this->assertFalse($badcalled);
}
/**
* Test that calling deprecated method strip_blacklisted_helpers() still works and shows developer debugging.
*/
public function test_deprecated_strip_blacklisted_helpers() {
$collection = new mustache_helper_collection(null, ['js']);
$stripped = $collection->strip_blacklisted_helpers(['js'], '{{#js}} JS {{/js}}');
$this->assertEquals('{{}}', $stripped);
$this->assertDebuggingCalled('mustache_helper_collection::strip_blacklisted_helpers() is deprecated. ' .
'Please use mustache_helper_collection::strip_disallowed_helpers() instead.', DEBUG_DEVELOPER);
}
}

View File

@ -56,6 +56,10 @@ information provided here is intended especially for developers.
The old class locations have been aliased for backwards compatibility and will emit a deprecation notice in a future
release.
* The following methods, deprecated since 3.10, have been removed and can no longer be used:
- `\core\output\mustache_helper_collection::strip_blacklisted_helpers`
- `\core_form\filetypes_util::is_whitelisted`
- `\core_form\filetypes_util::get_not_whitelisted`
* Convert a floating value to an integer in lib/graphlib.php to avoid PHP 8.1 deprecated function error.
* The $required parameter for \core_external\external_description is now being validated in order to prevent
unintentionally passing incorrect parameters to the external_description's (and its subclasses') constructors (e.g. the parameter