mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-26 01:31:20 +02:00
18 lines
269 B
PHP
18 lines
269 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;
|
|
}
|
|
}
|