8000 bug #26072 [Workflow] Fixed the dump command (lyrixx) · fervo/symfony@ad13f07 · GitHub
[go: up one dir, main page]

Skip to content

Commit ad13f07

Browse files
committed
bug symfony#26072 [Workflow] Fixed the dump command (lyrixx)
This PR was merged into the 4.1-dev branch. Discussion ---------- [Workflow] Fixed the dump command | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | | License | MIT | Doc PR | --- * The 'label' option had a wrong mode * Simplified the code Commits ------- 3d01404 [Workflow] Fixed the dump command
2 parents 0733b17 + 3d01404 commit ad13f07

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ protected function configure()
3939
->setDefinition(array(
4040
new InputArgument('name', InputArgument::REQUIRED, 'A workflow name'),
4141
new InputArgument('marking', InputArgument::IS_ARRAY, 'A marking (a list of places)'),
42-
new InputOption('label', 'l', InputArgument::OPTIONAL, 'Labels a graph'),
42+
new InputOption('label', 'l', InputOption::VALUE_REQUIRED, 'Labels a graph'),
4343
new InputOption('dump-format', null, InputOption::VALUE_REQUIRED, 'The dump format [dot|puml]', 'dot'),
4444
))
4545
->setDescription('Dump a workflow')
4646
->setHelp(<<<'EOF'
4747
The <info>%command.name%</info> command dumps the graphical representation of a
4848
workflow in different formats
4949
50-
<info>DOT</info>: %command.full_name% <workflow name> | dot -Tpng > workflow.png
50+
<info>DOT</info>: %command.full_name% <workflow name> | dot -Tpng > workflow.png
5151
<info>PUML</info>: %command.full_name% <workflow name> --dump-format=puml | java -jar plantuml.jar -p > workflow.png
5252

5353
EOF
@@ -74,9 +74,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
7474
}
7575

7676
if ('puml' === $input->getOption('dump-format')) {
77-
$dumper = new PlantUmlDumper(
78-
'workflow' === $type ? PlantUmlDumper::WORKFLOW_TRANSITION : PlantUmlDumper::STATEMACHINE_TRANSITION
79-
);
77+
$transitionType = 'workflow' === $type ? PlantUmlDumper::WORKFLOW_TRANSITION : PlantUmlDumper::STATEMACHINE_TRANSITION;
78+
$dumper = new PlantUmlDumper($transitionType);
8079
} elseif ('workflow' === $type) {
8180
$dumper = new GraphvizDumper();
8281
} else {
@@ -89,12 +88,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
8988
$marking->mark($place);
9089
}
9190

92-
$options = array();
93-
$label = $input->getOption('label');
94-
if (null !== $label && '' !== trim($label)) {
95-
$options = array('graph' => array('label' => $label));
96-
}
97-
$options = array_replace($options, array('name' => $serviceId, 'nofooter' => true));
91+
$options = array(
92+
'name' => $serviceId,
93+
'nofooter' => true,
94+
'graph' => array(
95+
'label' => $input->getOption('label'),
96+
),
97+
);
9898
$output->writeln($dumper->dump($workflow->getDefinition(), $marking, $options));
9999
}
100100
}

0 commit comments

Comments
 (0)
0