weekly release 5.0dev
[moodle.git] / filter / classes / null_filter_manager.php
blobf24759a1ab7e841ae6026bc8494a9eb907f7dfb6
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17 namespace core_filters;
19 use core\context;
21 /**
22 * Filter manager subclass that does nothing. Having this simplifies the logic
23 * of format_text, etc.
25 * @package core_filters
26 * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
27 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
29 class null_filter_manager {
30 /**
31 * As for the equivalent {@see filter_manager} method.
33 * @param string $text The text to filter
34 * @param context $context not used.
35 * @param array $options not used
36 * @param null|array $skipfilters not used
37 * @return string resulting text.
39 public function filter_text(
40 $text,
41 $context,
42 array $options = [],
43 ?array $skipfilters = null
44 ) {
45 return $text;
48 /**
49 * As for the equivalent {@see filter_manager} method.
51 * @param string $string The text to filter
52 * @param context $context not used.
53 * @return string resulting string
55 public function filter_string($string, $context) {
56 return $string;
60 // Alias this class to the old name.
61 // This file will be autoloaded by the legacyclasses autoload system.
62 // In future all uses of this class will be corrected and the legacy references will be removed.
63 class_alias(null_filter_manager::class, \null_filter_manager::class);