| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, $inTightList = false): string|HtmlElement|null { |
||
| 18 | if(!$block instanceof AlertBlock) { |
||
| 19 | throw new InvalidArgumentException(sprintf('$block must be of type "%s" ("%s" given)', AlertBlock::class, $block::class)); |
||
| 20 | } |
||
| 21 | |||
| 22 | return new HtmlElement('div', [ |
||
| 23 | 'class' => 'alert alert-' . $block->getType(), |
||
| 24 | ], $htmlRenderer->renderBlocks($block->children())); |
||
| 25 | } |
||
| 26 | } |