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