Skip to content

Commit 20199cf

Browse files
committed
Updated expression field
1 parent 2ea8f04 commit 20199cf

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

examples/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ fastmap:
33
- field: '[sku]'
44
copy: 'input[sku]'
55
- field: '[title]'
6-
expression: '@=(input["sku"] ~" | "~ input["name"])'
6+
expression: 'input["sku"] ~" | "~ input["name"]'
77
- field: '[name]'
88
copy: '[name]'
99
- field: '[staticValue]'

src/Configuration.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
66
use Symfony\Component\Config\Definition\ConfigurationInterface;
77
use Symfony\Component\Config\Definition\NodeInterface;
8-
use function Kiboko\Component\SatelliteToolbox\Configuration\asExpression;
9-
use function Kiboko\Component\SatelliteToolbox\Configuration\isExpression;
8+
use Symfony\Component\ExpressionLanguage\Expression;
109

1110
final class Configuration implements ConfigurationInterface
1211
{
@@ -260,8 +259,7 @@ private function getChildTreeBuilder(string $name): TreeBuilder
260259
->scalarNode('copy')->end()
261260
->scalarNode('expression')
262261
->validate()
263-
->ifTrue(isExpression())
264-
->then(asExpression())
262+
->always(fn ($data) => new Expression($data))
265263
->end()
266264
->end()
267265
->scalarNode('constant')->end()

0 commit comments

Comments
 (0)