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