Total Complexity | 4 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
25 | class StripAttributesExtension extends AbstractExtension |
||
26 | { |
||
27 | /** |
||
28 | * Removes attributes from tags in html string |
||
29 | * |
||
30 | * @var AttributeRemover |
||
31 | */ |
||
32 | private $attributeRemover; |
||
33 | |||
34 | /** |
||
35 | * StripAttributesExtension constructor. |
||
36 | * |
||
37 | * @param AttributeRemover $attributeRemover Removes attributes from tags in html string |
||
38 | */ |
||
39 | public function __construct(AttributeRemover $attributeRemover) |
||
40 | { |
||
41 | $this->attributeRemover = $attributeRemover; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | public function getFilters() |
||
51 | ]; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * Removes any attributes from tags in html string |
||
56 | * |
||
57 | * @param string $html Html string |
||
58 | * |
||
59 | * @return string|null |
||
60 | */ |
||
61 | public function removeAttributesFromTags(?string $html): ?string |
||
68 | } |
||
69 | } |
||
70 |