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