| 1 | <?php |
||
| 5 | class TemplateFormatter { |
||
| 6 | /** |
||
| 7 | * @var array<string, string> |
||
| 8 | */ |
||
| 9 | private $vars = []; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | private $template; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param string $template |
||
| 18 | */ |
||
| 19 | public function __construct(string $template) { |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param string $var |
||
| 25 | * @param string $value |
||
| 26 | * |
||
| 27 | * @return $this |
||
| 28 | */ |
||
| 29 | public function set(string $var, string $value): self { |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param string $var |
||
| 37 | * @param string $value |
||
| 38 | * |
||
| 39 | * @return $this |
||
| 40 | */ |
||
| 41 | public function append(string $var, string $value): self { |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | public function format(): string { |
||
| 59 | } |