Files
Reservair/includes/Services/Forms/RsvFormCalculatedValues.php
T

20 lines
585 B
PHP
Raw Normal View History

2026-06-16 19:33:55 +02:00
<?php
/** Values derived from a submission (not entered by the visitor), exposed to templates. */
final class RsvFormCalculatedValues {
/** @return array<string, mixed> */
public function for(RsvFormDefinition $definition, RsvFormData $data): array {
return [
'price' => (new RsvFormPriceCalculator())->calculate($definition, $data),
];
}
/**
* The names these values expose, so template validation accepts {{ price }}.
* @return list<string>
*/
public static function names(): array {
return ['price'];
}
}