diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index a599a684af7cd..a45de43954e52 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -810,9 +810,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $ // Create Workflow $workflowDefinition = new ChildDefinition(sprintf('%s.abstract', $type)); $workflowDefinition->replaceArgument(0, new Reference(sprintf('%s.definition', $workflowId))); - if (isset($markingStoreDefinition)) { - $workflowDefinition->replaceArgument(1, $markingStoreDefinition); - } + $workflowDefinition->replaceArgument(1, $markingStoreDefinition ?? null); $workflowDefinition->replaceArgument(3, $name); $workflowDefinition->replaceArgument(4, $workflow['events_to_dispatch']); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index e9d141d528757..0fc7b47d561d4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -226,7 +226,13 @@ public function testWorkflows() $this->assertTrue($container->hasDefinition('workflow.article'), 'Workflow is registered as a service'); $this->assertSame('workflow.abstract', $container->getDefinition('workflow.article')->getParent()); - $this->assertNull($container->getDefinition('workflow.article')->getArgument('index_4'), 'Workflows has eventsToDispatch=null'); + + $args = $container->getDefinition('workflow.article')->getArguments(); + $this->assertArrayHasKey('index_0', $args); + $this->assertArrayHasKey('index_1', $args); + $this->assertArrayHasKey('index_3', $args); + $this->assertArrayHasKey('index_4', $args); + $this->assertNull($args['index_4'], 'Workflows has eventsToDispatch=null'); $this->assertTrue($container->hasDefinition('workflow.article.definition'), 'Workflow definition is registered as a service');