diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 497fb08424..2b76352048 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -303,7 +303,7 @@ class Configuration implements ConfigurationInterface ->end() ->end() ->scalarNode('property') - ->defaultValue('marking') + ->defaultNull() // In Symfony 5.0, set "marking" as default property ->end() ->scalarNode('service') ->cannotBeEmpty() @@ -481,6 +481,14 @@ class Configuration implements ConfigurationInterface return $v; }) ->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() diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 3fd5ff9028..8b64507d0a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -666,7 +666,7 @@ class FrameworkExtension extends Extension if ('method' === $workflow['marking_store']['type']) { $markingStoreDefinition->setArguments([ 'state_machine' === $type, //single state - $workflow['marking_store']['property'], + $workflow['marking_store']['property'] ?? 'marking', ]); } else { foreach ($workflow['marking_store']['arguments'] as $argument) {