From ec06cdd17b2c5830df590b915fdeca9c47423ab6 Mon Sep 17 00:00:00 2001 From: shdev Date: Fri, 24 Nov 2017 15:41:30 +0100 Subject: [PATCH 1/8] Update WorkflowDumpCommand.php - Workflow Command labels a graph with workflow name if option is set --- .../FrameworkBundle/Command/WorkflowDumpCommand.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php index 1c031f5999acf..58bb4d15474d8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php @@ -37,6 +37,7 @@ protected function configure() ->setDefinition(array( new InputArgument('name', InputArgument::REQUIRED, 'A workflow name'), new InputArgument('marking', InputArgument::IS_ARRAY, 'A marking (a list of places)'), + new InputOption('workflow-name-label', null, null, 'Labels graph with workflow name'), )) ->setDescription('Dump a workflow') ->setHelp(<<<'EOF' @@ -73,6 +74,11 @@ protected function execute(InputInterface $input, OutputInterface $output) $marking->mark($place); } - $output->writeln($dumper->dump($workflow->getDefinition(), $marking)); + $options = []; + if ($input->getOption('workflow-name-label')) { + $options = ['graph' => ['label' => $serviceId]]; + } + + $output->writeln($dumper->dump($workflow->getDefinition(), $marking, $options)); } } From e1399429fdcccb9516fd1e6135dff7a2eca357e6 Mon Sep 17 00:00:00 2001 From: shdev Date: Fri, 24 Nov 2017 15:45:03 +0100 Subject: [PATCH 2/8] Update CHANGELOG.md --- src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index 877b4abeedc56..187254f543a80 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -7,6 +7,7 @@ CHANGELOG * Allowed to pass an optional `LoggerInterface $logger` instance to the `Router` * Added a new `parameter_bag` service with related autowiring aliases to access parameters as-a-service * Allowed the `Router` to work with any PSR-11 container + * added option in workflow dump command to label graph with workflow name 4.0.0 ----- From dc96105bf733f693b102c00e821ba5d454f6dc33 Mon Sep 17 00:00:00 2001 From: shdev Date: Fri, 24 Nov 2017 15:57:43 +0100 Subject: [PATCH 3/8] Update WorkflowDumpCommand.php - [] -> array() --- .../Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php index 58bb4d15474d8..4aab8b11b83dc 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php @@ -74,9 +74,9 @@ protected function execute(InputInterface $input, OutputInterface $output) $marking->mark($place); } - $options = []; + $options = array(); if ($input->getOption('workflow-name-label')) { - $options = ['graph' => ['label' => $serviceId]]; + $options = array('graph' => array('label' => $serviceId)); } $output->writeln($dumper->dump($workflow->getDefinition(), $marking, $options)); From be00cdc8edd5386c8042e9ab7e2e3d32d9b3dd4a Mon Sep 17 00:00:00 2001 From: shdev Date: Sun, 3 Dec 2017 23:24:12 +0100 Subject: [PATCH 4/8] Update WorkflowDumpCommand.php - Improvement from @ro0NL --- .../FrameworkBundle/Command/WorkflowDumpCommand.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php index 4aab8b11b83dc..086f0de83e51d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php @@ -14,6 +14,7 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Workflow\Dumper\GraphvizDumper; use Symfony\Component\Workflow\Dumper\StateMachineGraphvizDumper; @@ -37,7 +38,7 @@ protected function configure() ->setDefinition(array( new InputArgument('name', InputArgument::REQUIRED, 'A workflow name'), new InputArgument('marking', InputArgument::IS_ARRAY, 'A marking (a list of places)'), - new InputOption('workflow-name-label', null, null, 'Labels graph with workflow name'), + new InputOption('label', 'l', InputArgument::OPTIONAL, 'Labels a graph'), )) ->setDescription('Dump a workflow') ->setHelp(<<<'EOF' @@ -75,10 +76,10 @@ protected function execute(InputInterface $input, OutputInterface $output) } $options = array(); - if ($input->getOption('workflow-name-label')) { - $options = array('graph' => array('label' => $serviceId)); + $label = $input->getOption('label'); + if (null !== $label && '' !== trim($label)) { + $options = array('graph' => array('label' => $input->getOption('label'))); } - $output->writeln($dumper->dump($workflow->getDefinition(), $marking, $options)); } } From 6c7473df9067d264a6df92107bd3d43af713fd26 Mon Sep 17 00:00:00 2001 From: shdev Date: Sun, 3 Dec 2017 23:24:54 +0100 Subject: [PATCH 5/8] Update CHANGELOG.md --- src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index 187254f543a80..b56f57d72e365 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -1,13 +1,14 @@ CHANGELOG ========= +<<<<<<< HEAD 4.1.0 ----- * Allowed to pass an optional `LoggerInterface $logger` instance to the `Router` * Added a new `parameter_bag` service with related autowiring aliases to access parameters as-a-service * Allowed the `Router` to work with any PSR-11 container - * added option in workflow dump command to label graph with workflow name + * added option in workflow dump command to label graph with custom label 4.0.0 ----- From 7cd3184f6022a3f0be25b4b237d481d76480c548 Mon Sep 17 00:00:00 2001 From: shdev Date: Sun, 3 Dec 2017 23:26:57 +0100 Subject: [PATCH 6/8] Update WorkflowDumpCommand.php - Fabbot.io suggestion --- .../Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php index 086f0de83e51d..8d2fef03b0862 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php @@ -38,7 +38,7 @@ protected function configure() ->setDefinition(array( new InputArgument('name', InputArgument::REQUIRED, 'A workflow name'), new InputArgument('marking', InputArgument::IS_ARRAY, 'A marking (a list of places)'), - new InputOption('label', 'l', InputArgument::OPTIONAL, 'Labels a graph'), + new InputOption('label', 'l', InputArgument::OPTIONAL, 'Labels a graph'), )) ->setDescription('Dump a workflow') ->setHelp(<<<'EOF' From 1b843f80e2c0fa96cfa4584f3ec71b177bd9fa4a Mon Sep 17 00:00:00 2001 From: shdev Date: Sun, 3 Dec 2017 23:32:18 +0100 Subject: [PATCH 7/8] Update CHANGELOG.md --- src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index b56f57d72e365..186b84dd0682e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -8,7 +8,8 @@ CHANGELOG * Allowed to pass an optional `LoggerInterface $logger` instance to the `Router` * Added a new `parameter_bag` service with related autowiring aliases to access parameters as-a-service * Allowed the `Router` to work with any PSR-11 container - * added option in workflow dump command to label graph with custom label + * allowed to pass an optional `LoggerInterface $logger` instance to the `Router` + * added option in workflow dump command to label graph with a custom label 4.0.0 ----- From 9d0dda3437ee6b8027f5f2d310e7f7be2378df0e Mon Sep 17 00:00:00 2001 From: shdev Date: Mon, 11 Dec 2017 23:24:10 +0100 Subject: [PATCH 8/8] Update WorkflowDumpCommand.php --- src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md | 2 -- .../Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index 186b84dd0682e..cce49df71ff34 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -1,14 +1,12 @@ CHANGELOG ========= -<<<<<<< HEAD 4.1.0 ----- * Allowed to pass an optional `LoggerInterface $logger` instance to the `Router` * Added a new `parameter_bag` service with related autowiring aliases to access parameters as-a-service * Allowed the `Router` to work with any PSR-11 container - * allowed to pass an optional `LoggerInterface $logger` instance to the `Router` * added option in workflow dump command to label graph with a custom label 4.0.0 diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php index 8d2fef03b0862..b2bc3e5e2c8b6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php @@ -78,7 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $options = array(); $label = $input->getOption('label'); if (null !== $label && '' !== trim($label)) { - $options = array('graph' => array('label' => $input->getOption('label'))); + $options = array('graph' => array('label' => $label)); } $output->writeln($dumper->dump($workflow->getDefinition(), $marking, $options)); }