@@ -0,0 +1,18 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user