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