mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-05-09 16:12:05 +02:00
22 lines
328 B
PHP
22 lines
328 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Structural\Composite;
|
|
|
|
class TextElement implements RenderableInterface
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $text;
|
|
|
|
public function __construct(string $text)
|
|
{
|
|
$this->text = $text;
|
|
}
|
|
|
|
public function render(): string
|
|
{
|
|
return $this->text;
|
|
}
|
|
}
|