Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
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 TableCell) { |
|
28 | 3 | throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block)); |
|
29 | } |
||
30 | |||
31 | 75 | $attrs = $block->getData('attributes', []); |
|
32 | |||
33 | 75 | if ($block->align !== null) { |
|
34 | 15 | $attrs['align'] = $block->align; |
|
35 | } |
||
36 | |||
37 | 75 | return new HtmlElement($block->type, $attrs, $htmlRenderer->renderInlines($block->children())); |
|
38 | } |
||
39 | } |
||
40 |