mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-28 18:50:11 +02:00
16 lines
268 B
PHP
16 lines
268 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Structural\Composite;
|
|
|
|
class TextElement implements Renderable
|
|
{
|
|
public function __construct(private string $text)
|
|
{
|
|
}
|
|
|
|
public function render(): string
|
|
{
|
|
return $this->text;
|
|
}
|
|
}
|