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

29 lines
542 B
PHP

<?php
declare(strict_types=1);
namespace Doctrine\RST\Renderers;
use Doctrine\RST\Nodes\DocumentNode;
final class DocumentNodeRenderer implements NodeRenderer
{
/** @var DocumentNode */
private $document;
public function __construct(DocumentNode $document)
{
$this->document = $document;
}
public function render(): string
{
$document = '';
foreach ($this->document->getNodes() as $node) {
$document .= $node->render() . "\n";
}
return $document;
}
}