Total Complexity | 3 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
27 | final class HtmlBlockRenderer implements NodeRendererInterface, ConfigurationAwareInterface |
||
28 | { |
||
29 | /** |
||
30 | * @var ConfigurationInterface |
||
31 | * |
||
32 | * @psalm-readonly-allow-private-mutation |
||
33 | */ |
||
34 | private $config; |
||
35 | |||
36 | /** |
||
37 | * @param HtmlBlock $node |
||
38 | * |
||
39 | * {@inheritdoc} |
||
40 | * |
||
41 | * @psalm-suppress MoreSpecificImplementedParamType |
||
42 | */ |
||
43 | 186 | public function render(Node $node, ChildNodeRendererInterface $childRenderer) |
|
44 | { |
||
45 | 186 | if (! ($node instanceof HtmlBlock)) { |
|
46 | 3 | throw new \InvalidArgumentException('Incompatible node type: ' . \get_class($node)); |
|
47 | } |
||
48 | |||
49 | 183 | $htmlInput = $this->config->get('html_input'); |
|
50 | |||
51 | 183 | return HtmlFilter::filter($node->getLiteral(), $htmlInput); |
|
52 | } |
||
53 | |||
54 | 3000 | public function setConfiguration(ConfigurationInterface $configuration): void |
|
57 | 3000 | } |
|
58 | } |
||
59 |