Files
DesignPatternsPHP/Structural/Composite/TextElement.php
2019-08-19 18:11:49 +02:00

22 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;
}
}