mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-24 10:13:17 +02:00
19 lines
330 B
PHP
19 lines
330 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Structural\Flyweight;
|
|
|
|
class Word implements Text
|
|
{
|
|
private string $name;
|
|
|
|
public function __construct(string $name)
|
|
{
|
|
$this->name = $name;
|
|
}
|
|
|
|
public function render(string $font): string
|
|
{
|
|
return sprintf('Word %s with font %s', $this->name, $font);
|
|
}
|
|
}
|