From 9f38628abc23e76f06a76f9f8e44655545c65669 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Mon, 25 Jun 2018 15:16:23 +0100 Subject: [PATCH] MDL-62792 filters: fix some bad PHPdocs --- lib/filterlib.php | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/lib/filterlib.php b/lib/filterlib.php index 0a9753ba4f6..693922cd25f 100644 --- a/lib/filterlib.php +++ b/lib/filterlib.php @@ -302,15 +302,36 @@ class filter_manager { * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class null_filter_manager { + /** + * As for the equivalent {@link filter_manager} method. + * + * @param string $text The text to filter + * @param context $context not used. + * @param array $options not used + * @param array $skipfilters not used + * @return string resulting text. + */ public function filter_text($text, $context, array $options = array(), array $skipfilters = null) { return $text; } + /** + * As for the equivalent {@link filter_manager} method. + * + * @param string $string The text to filter + * @param context $context not used. + * @return string resulting string + */ public function filter_string($string, $context) { return $string; } + /** + * As for the equivalent {@link filter_manager} method. + * + * @deprecated Since Moodle 3.0 MDL-50491. + */ public function text_filtering_hash() { throw new coding_exception('filter_manager::text_filtering_hash() can not be used any more'); } @@ -429,9 +450,9 @@ abstract class moodle_text_filter { /** * Override this function to actually implement the filtering. * - * @param $text some HTML content. + * @param string $text some HTML content to process. * @param array $options options passed to the filters - * @return the HTML content after the filtering has been applied. + * @return string the HTML content after the filtering has been applied. */ public abstract function filter($text, array $options = array()); } @@ -520,8 +541,6 @@ function filter_get_name($filter) { * sorted in alphabetical order of name. */ function filter_get_all_installed() { - global $CFG; - $filternames = array(); foreach (core_component::get_plugin_list('filter') as $filter => $fulldir) { if (is_readable("$fulldir/filter.php")) { @@ -1428,9 +1447,10 @@ function filter_phrases($text, &$link_array, $ignoretagsopen=NULL, $ignoretagscl } /** - * @todo Document this function - * @param array $linkarray - * @return array + * Remove duplicate from a list of {@link filterobject}. + * + * @param filterobject[] $linkarray a list of filterobject. + * @return filterobject[] the same list, but with dupicates removed. */ function filter_remove_duplicates($linkarray) {