gl-website-deployer/vendor/doctrine/rst-parser/lib/LaTeX/Renderers/CodeNodeRenderer.php
2024-11-19 08:02:04 +01:00

32 lines
734 B
PHP

<?php
declare(strict_types=1);
namespace Doctrine\RST\LaTeX\Renderers;
use Doctrine\RST\Nodes\CodeNode;
use Doctrine\RST\Renderers\NodeRenderer;
use Doctrine\RST\Templates\TemplateRenderer;
final class CodeNodeRenderer implements NodeRenderer
{
/** @var CodeNode */
private $codeNode;
/** @var TemplateRenderer */
private $templateRenderer;
public function __construct(CodeNode $codeNode, TemplateRenderer $templateRenderer)
{
$this->codeNode = $codeNode;
$this->templateRenderer = $templateRenderer;
}
public function render(): string
{
return $this->templateRenderer->render('code.tex.twig', [
'codeNode' => $this->codeNode,
]);
}
}