From 387ec98cfd09008095d07348a4bfa724462270a6 Mon Sep 17 00:00:00 2001 From: "hubert.lenoir" Date: Thu, 19 Oct 2017 11:03:54 +0200 Subject: [PATCH 1/5] [Workflow] Fix deprectation when checking workflow.registry service in dump command --- .../FrameworkBundle/DependencyInjection/FrameworkExtension.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 5eb3c24dff08f..aca989fe76b5e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -639,7 +639,6 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $ $container->getDefinition('workflow.marking_store.multiple_state')->setPrivate(true); $container->getDefinition('workflow.marking_store.single_state')->setPrivate(true); - $container->getDefinition('workflow.registry')->setPrivate(true); $registryDefinition = $container->getDefinition('workflow.registry'); From d27abc5a895ac726e5ae702586e7c25743bf83d4 Mon Sep 17 00:00:00 2001 From: "hubert.lenoir" Date: Thu, 19 Oct 2017 17:27:59 +0200 Subject: [PATCH 2/5] Move workflow command definition in workflow.xml --- .../FrameworkBundle/Command/WorkflowDumpCommand.php | 10 ---------- .../DependencyInjection/FrameworkExtension.php | 1 + .../FrameworkBundle/Resources/config/console.xml | 4 ---- .../FrameworkBundle/Resources/config/workflow.xml | 4 ++++ 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php index 9923f657794f8..3d72226c677c3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php @@ -27,16 +27,6 @@ class WorkflowDumpCommand extends ContainerAwareCommand { protected static $defaultName = 'workflow:dump'; - /** - * {@inheritdoc} - * - * BC to be removed in 4.0 - */ - public function isEnabled() - { - return $this->getContainer()->has('workflow.registry'); - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index aca989fe76b5e..5eb3c24dff08f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -639,6 +639,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $ $container->getDefinition('workflow.marking_store.multiple_state')->setPrivate(true); $container->getDefinition('workflow.marking_store.single_state')->setPrivate(true); + $container->getDefinition('workflow.registry')->setPrivate(true); $registryDefinition = $container->getDefinition('workflow.registry'); diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/console.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/console.xml index cebf6014f0462..534f6ba4ff12f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/console.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/console.xml @@ -89,10 +89,6 @@ - - - - diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/workflow.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/workflow.xml index d881f699f75ec..989903c55d083 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/workflow.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/workflow.xml @@ -27,5 +27,9 @@ + + + + From 5a075005d0aeb1c8223c098b0be4f9d6f07d05f2 Mon Sep 17 00:00:00 2001 From: "hubert.lenoir" Date: Fri, 20 Oct 2017 09:16:22 +0200 Subject: [PATCH 3/5] Remove useless Command deletion --- .../DependencyInjection/FrameworkExtension.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 5eb3c24dff08f..924637df157c1 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -17,7 +17,6 @@ use Symfony\Bundle\FrameworkBundle\Command\RouterMatchCommand; use Symfony\Bundle\FrameworkBundle\Command\TranslationDebugCommand; use Symfony\Bundle\FrameworkBundle\Command\TranslationUpdateCommand; -use Symfony\Bundle\FrameworkBundle\Command\WorkflowDumpCommand; use Symfony\Bundle\FrameworkBundle\Command\XliffLintCommand; use Symfony\Bundle\FrameworkBundle\Command\YamlLintCommand; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -624,10 +623,6 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $ private function registerWorkflowConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader) { if (!$config['enabled']) { - if (!class_exists(Workflow\Workflow::class)) { - $container->removeDefinition(WorkflowDumpCommand::class); - } - return; } From 40321a8bf6536c20d4b89b9db98f9768c3e01462 Mon Sep 17 00:00:00 2001 From: "hubert.lenoir" Date: Fri, 20 Oct 2017 10:50:31 +0200 Subject: [PATCH 4/5] Remove command if workflow is disabled --- .../DependencyInjection/FrameworkExtension.php | 5 +++++ .../Bundle/FrameworkBundle/Resources/config/console.xml | 4 ++++ .../Bundle/FrameworkBundle/Resources/config/workflow.xml | 4 ---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 924637df157c1..68697ea5a6131 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -17,6 +17,7 @@ use Symfony\Bundle\FrameworkBundle\Command\RouterMatchCommand; use Symfony\Bundle\FrameworkBundle\Command\TranslationDebugCommand; use Symfony\Bundle\FrameworkBundle\Command\TranslationUpdateCommand; +use Symfony\Bundle\FrameworkBundle\Command\WorkflowDumpCommand; use Symfony\Bundle\FrameworkBundle\Command\XliffLintCommand; use Symfony\Bundle\FrameworkBundle\Command\YamlLintCommand; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -623,6 +624,10 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $ private function registerWorkflowConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader) { if (!$config['enabled']) { + if ($container->hasDefinition(WorkflowDumpCommand::class)) { + $container->removeDefinition(WorkflowDumpCommand::class); + } + return; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/console.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/console.xml index 534f6ba4ff12f..cebf6014f0462 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/console.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/console.xml @@ -89,6 +89,10 @@ + + + + diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/workflow.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/workflow.xml index 989903c55d083..d881f699f75ec 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/workflow.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/workflow.xml @@ -27,9 +27,5 @@ - - - - From 7021405893c65c84c65033a961146e2dc52b6aaa Mon Sep 17 00:00:00 2001 From: "hubert.lenoir" Date: Fri, 20 Oct 2017 20:43:28 +0200 Subject: [PATCH 5/5] Remove useless test --- .../DependencyInjection/FrameworkExtension.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 68697ea5a6131..fd5dd49e9ddc0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -624,9 +624,7 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $ private function registerWorkflowConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader) { if (!$config['enabled']) { - if ($container->hasDefinition(WorkflowDumpCommand::class)) { - $container->removeDefinition(WorkflowDumpCommand::class); - } + $container->removeDefinition(WorkflowDumpCommand::class); return; }