Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / filter / tests / filter_test / src / Plugin / Filter / FilterTestAssets.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 attach assets
10  *
11  * @Filter(
12  *   id = "filter_test_assets",
13  *   title = @Translation("Testing filter"),
14  *   description = @Translation("Does not change content; attaches assets."),
15  *   type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE
16  * )
17  */
18 class FilterTestAssets extends FilterBase {
19
20   /**
21    * {@inheritdoc}
22    */
23   public function process($text, $langcode) {
24     $result = new FilterProcessResult($text);
25     $result->addAttachments([
26       'library' => [
27         'filter/caption',
28       ],
29     ]);
30     return $result;
31   }
32
33 }