19 lines
478 B
PHP
19 lines
478 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Reservair\Templating;
|
||
|
|
|
||
|
|
/** Immutable symbol table passed to custom-element handlers. */
|
||
|
|
class RsvTemplateSymbols {
|
||
|
|
/** @param array<string, mixed> $data */
|
||
|
|
public function __construct(private readonly array $data) {}
|
||
|
|
|
||
|
|
/** @return array<string, mixed> */
|
||
|
|
public function all(): array {
|
||
|
|
return $this->data;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function get(string $name, mixed $default = null): mixed {
|
||
|
|
return $this->data[$name] ?? $default;
|
||
|
|
}
|
||
|
|
}
|