Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
25 | 78 | public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, bool $inTightList = false) |
|
26 | { |
||
27 | 78 | if (!$block instanceof TableSection) { |
|
28 | 3 | throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block)); |
|
29 | } |
||
30 | |||
31 | 75 | if (!$block->hasChildren()) { |
|
32 | 6 | return ''; |
|
33 | } |
||
34 | |||
35 | 72 | $attrs = $block->getData('attributes', []); |
|
36 | |||
37 | 72 | $separator = $htmlRenderer->getOption('inner_separator', "\n"); |
|
38 | |||
39 | 72 | return new HtmlElement($block->type, $attrs, $separator . $htmlRenderer->renderBlocks($block->children()) . $separator); |
|
40 | } |
||
41 | } |
||
42 |