gl-website-deployer/vendor/doctrine/rst-parser/lib/Nodes/WrapperNode.php

34 lines
650 B
PHP
Raw Permalink Normal View History

2024-11-19 08:02:04 +01:00
<?php
declare(strict_types=1);
namespace Doctrine\RST\Nodes;
final class WrapperNode extends Node
{
/** @var Node|null */
private $node;
/** @var string */
private $before;
/** @var string */
private $after;
public function __construct(?Node $node, string $before = '', string $after = '')
{
parent::__construct();
$this->node = $node;
$this->before = $before;
$this->after = $after;
}
protected function doRender(): string
{
$contents = $this->node !== null ? $this->node->render() : '';
return $this->before . $contents . $this->after;
}
}