Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / filter / tests / filter_test / src / Plugin / Filter / FilterTestReplace.php
1 <?php
2
3 namespace Drupal\filter_test\Plugin\Filter;
4
5 use Drupal\filter\FilterProcessResult;
6 use Drupal\filter\Plugin\FilterBase;
7
8 /**
9  * Provides a test filter to replace all content.
10  *
11  * @Filter(
12  *   id = "filter_test_replace",
13  *   title = @Translation("Testing filter"),
14  *   description = @Translation("Replaces all content with filter and text format information."),
15  *   type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE
16  * )
17  */
18 class FilterTestReplace extends FilterBase {
19
20   /**
21    * {@inheritdoc}
22    */
23   public function process($text, $langcode) {
24     $text = [];
25     $text[] = 'Filter: ' . $this->getLabel() . ' (' . $this->getPluginId() . ')';
26     $text[] = 'Language: ' . $langcode;
27     return new FilterProcessResult(implode("<br />\n", $text));
28   }
29
30 }