| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function render(array $context): StreamInterface |
||
| 43 | { |
||
| 44 | foreach ($context as $key => &$value) { |
||
| 45 | if ($value instanceof BlockInterface) { |
||
| 46 | $additionalContext = [ |
||
| 47 | 'parent' => $context, |
||
| 48 | 'page' => $context['page'] ?? $context |
||
| 49 | ]; |
||
| 50 | |||
| 51 | $value = $this->blockRenderer->renderBlock($value, $additionalContext); |
||
| 52 | } |
||
| 53 | } |
||
| 54 | |||
| 55 | $text = $this->twig->render($this->template, $context); |
||
| 56 | |||
| 57 | $stream = new Stream('php://temp', 'wb+'); |
||
| 58 | $stream->write($text); |
||
| 59 | $stream->rewind(); |
||
| 60 | |||
| 61 | return $stream; |
||
| 62 | } |
||
| 64 |