ecotone-dev
ecotone-dev copied to clipboard
Add parameter("...") support in Ecotone expression attributes
I’m working with Symfony + Ecotone and ran into a limitation with expression attributes like:
#[Delayed(expression: '%app.timeout% * 60 * 1000')]
Using %...% placeholders requires pre-processing and causes syntax errors during tests.
I wanted to propose an alternative approach: introducing a parameter("...") function in Ecotone expressions, so it could look like this:
#[Delayed(expression: 'parameter("app.timeout") * 60 * 1000')]
Benefits:
- No parsing of %...% required, native Ecotone expressions
- Works seamlessly with Symfony’s ParameterBagInterface
- Cleaner syntax and easier testing
Would you be open to adding this feature? I can prepare a PR if you agree.
Thanks!
Hey @ralfkuehnel,
I think make sense, feel free to open PR.
Please use ConfigurationVariableService to fetch parameters, as this is the Service that work across different implementations (Symfony, Laravel, Ecotone Lite).