Files
DesignPatternsPHP/Structural/Composite/TextElement.php
2019-08-19 17:12:29 +02:00

23 lines
344 B
PHP

<?php
declare(strict_types=1);
namespace DesignPatterns\Structural\Composite;
class TextElement implements Renderable
{
/**
* @var string
*/
private $text;
public function __construct(string $text)
{
$this->text = $text;
}
public function render(): string
{
return $this->text;
}
}