File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 44
55use Symfony \Component \Config \Definition \Builder \TreeBuilder ;
66use Symfony \Component \Config \Definition \ConfigurationInterface ;
7+ use Symfony \Component \Config \Definition \Exception \InvalidConfigurationException ;
78use function Kiboko \Component \SatelliteToolbox \Configuration \asExpression ;
89use function Kiboko \Component \SatelliteToolbox \Configuration \isExpression ;
910
@@ -23,12 +24,18 @@ public function getConfigTreeBuilder()
2324 ->end ()
2425 ->arrayPrototype ()
2526 ->children ()
26- ->scalarNode ('key ' )
27+ ->variableNode ('key ' )
2728 ->isRequired ()
2829 ->validate ()
2930 ->ifTrue (isExpression ())
3031 ->then (asExpression ())
3132 ->end ()
33+ ->validate ()
34+ ->ifTrue (function ($ value ) {
35+ return !is_string ($ value ) && !is_int ($ value );
36+ })
37+ ->thenInvalid ('The parameter \'s key must be of a string or an integer. ' )
38+ ->end ()
3239 ->end ()
3340 ->scalarNode ('value ' )
3441 ->isRequired ()
You can’t perform that action at this time.
0 commit comments