Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
34 | 165 | public function render(Node $node, ChildNodeRendererInterface $childRenderer) |
|
35 | { |
||
36 | 165 | if (! ($node instanceof BlockQuote)) { |
|
37 | 3 | throw new \InvalidArgumentException('Incompatible node type: ' . \get_class($node)); |
|
38 | } |
||
39 | |||
40 | 162 | $attrs = $node->data->get('attributes'); |
|
41 | |||
42 | 162 | $filling = $childRenderer->renderNodes($node->children()); |
|
43 | 162 | $innerSeparator = $childRenderer->getInnerSeparator(); |
|
44 | 162 | if ($filling === '') { |
|
45 | 12 | return new HtmlElement('blockquote', $attrs, $innerSeparator); |
|
46 | } |
||
47 | |||
48 | 150 | return new HtmlElement( |
|
49 | 150 | 'blockquote', |
|
50 | $attrs, |
||
51 | 150 | $innerSeparator . $filling . $innerSeparator |
|
52 | ); |
||
55 |