[Workflow] Made the configuration more robust for the 'property' key
This commit is contained in:
parent
3be177a93f
commit
0c31ff007e
@ -303,7 +303,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->scalarNode('property')
|
->scalarNode('property')
|
||||||
->defaultValue('marking')
|
->defaultNull() // In Symfony 5.0, set "marking" as default property
|
||||||
->end()
|
->end()
|
||||||
->scalarNode('service')
|
->scalarNode('service')
|
||||||
->cannotBeEmpty()
|
->cannotBeEmpty()
|
||||||
@ -481,6 +481,14 @@ class Configuration implements ConfigurationInterface
|
|||||||
return $v;
|
return $v;
|
||||||
})
|
})
|
||||||
->end()
|
->end()
|
||||||
|
->validate()
|
||||||
|
->ifTrue(function ($v) {
|
||||||
|
return isset($v['marking_store']['property'])
|
||||||
|
&& (!isset($v['marking_store']['type']) || 'method' !== $v['marking_store']['type'])
|
||||||
|
;
|
||||||
|
})
|
||||||
|
->thenInvalid('"property" option is only supported by the "method" marking store.')
|
||||||
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
|
@ -666,7 +666,7 @@ class FrameworkExtension extends Extension
|
|||||||
if ('method' === $workflow['marking_store']['type']) {
|
if ('method' === $workflow['marking_store']['type']) {
|
||||||
$markingStoreDefinition->setArguments([
|
$markingStoreDefinition->setArguments([
|
||||||
'state_machine' === $type, //single state
|
'state_machine' === $type, //single state
|
||||||
$workflow['marking_store']['property'],
|
$workflow['marking_store']['property'] ?? 'marking',
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
foreach ($workflow['marking_store']['arguments'] as $argument) {
|
foreach ($workflow['marking_store']['arguments'] as $argument) {
|
||||||
|
Reference in New Issue
Block a user