| Conditions | 4 |
| Paths | 4 |
| Total Lines | 28 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function render(array $context = []): string |
||
| 14 | { |
||
| 15 | /** @var MetaboxComponentInterface[] $components */ |
||
| 16 | $components = $context['components']; |
||
| 17 | $separator = $context['separator']; |
||
| 18 | $request = $context['request']; |
||
| 19 | |||
| 20 | $html = ''; |
||
| 21 | $html .= $context['auth_field']; |
||
| 22 | $html .= $this->open('div', ['class' => 'leonidas-wrap']); |
||
| 23 | |||
| 24 | $count = count($components); |
||
| 25 | |||
| 26 | foreach ($components as $component) { |
||
| 27 | $count--; |
||
| 28 | |||
| 29 | if ($component->shouldBeRendered($request)) { |
||
| 30 | $html .= $component->renderComponent($request); |
||
| 31 | |||
| 32 | if ($count > 0) { |
||
| 33 | $html .= $separator; |
||
| 34 | } |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | $html .= $this->close('div'); |
||
| 39 | |||
| 40 | return $html; |
||
| 41 | } |
||
| 43 |