getFormValueFunction(), $this->getRootFormPropertyFunction(), ]; } /** * Shortcut function to access field values */ protected function getFormValueFunction(): ExpressionFunction { return new ExpressionFunction( 'getFormValue', static fn() => null, // Not implemented, we only use the evaluator static function ($arguments, $field, $default = null) { return $arguments['formValues'][$field] ?? $default; } ); } protected function getRootFormPropertyFunction(): ExpressionFunction { return new ExpressionFunction( 'getRootFormProperty', static fn() => null, // Not implemented, we only use the evaluator static function ($arguments, $property) { $formDefinition = $arguments['formRuntime']->getFormDefinition(); try { $value = ObjectAccess::getPropertyPath($formDefinition, $property); } catch (\Exception) { $value = null; } return $value; } ); } }