Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.0261 |
Changes | 0 |
1 | <?php |
||
25 | 69 | public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, bool $inTightList = false) |
|
26 | { |
||
27 | 69 | if (!$block instanceof TableCell) { |
|
28 | throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block)); |
||
29 | } |
||
30 | |||
31 | 69 | $attrs = $block->getData('attributes', []); |
|
32 | |||
33 | 69 | if ($block->align) { |
|
|
|||
34 | 12 | $attrs['align'] = $block->align; |
|
35 | } |
||
36 | |||
37 | 69 | return new HtmlElement($block->type, $attrs, $htmlRenderer->renderInlines($block->children())); |
|
38 | } |
||
39 | } |
||
40 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: