8000 feature #25148 Pr/workflow name as graph label (shdev) · symfony/symfony@e19a34d · GitHub
[go: up one dir, main page]

Skip to content

Commit e19a34d

Browse files
committed
feature #25148 Pr/workflow name as graph label (shdev)
This PR was squashed before being merged into the 4.1-dev branch (closes #25148). Discussion ---------- Pr/workflow name as graph label | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This pull request added an option to the workflow dumper command, which allows you to add a graph label with the workflow name to the output. Without the option nothing changed the behavior from before. Example call: ```bash bin/console workflow:dump <workflowname> --label=custom_label ``` Commits ------- 0afce8d Pr/workflow name as graph label
2 parents 033e752 + 0afce8d commit e19a34d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CHANGELOG
77
* Allowed to pass an optional `LoggerInterface $logger` instance to the `Router`
88
* Added a new `parameter_bag` service with related autowiring aliases to access parameters as-a-service
99
* Allowed the `Router` to work with any PSR-11 container
10+
* added option in workflow dump command to label graph with a custom label
1011

1112
4.0.0
1213
-----

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Console\Command\Command;
1515
use Symfony\Component\Console\Input\InputArgument;
1616
use Symfony\Component\Console\Input\InputInterface;
17+
use Symfony\Component\Console\Input\InputOption;
1718
use Symfony\Component\Console\Output\OutputInterface;
1819
use Symfony\Component\Workflow\Dumper\GraphvizDumper;
1920
use Symfony\Component\Workflow\Dumper\StateMachineGraphvizDumper;
@@ -37,6 +38,7 @@ protected function configure()
3738
->setDefinition(array(
3839
new InputArgument('name', InputArgument::REQUIRED, 'A workflow name'),
3940
new InputArgument('marking', InputArgument::IS_ARRAY, 'A marking (a list of places)'),
41+
new InputOption('label', 'l', InputArgument::OPTIONAL, 'Labels a graph'),
4042
))
4143
->setDescription('Dump a workflow')
4244
->setHelp(<<<'EOF'
@@ -73,6 +75,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
7375
$marking->mark($place);
7476
}
7577

76-
$output->writeln($dumper->dump($workflow->getDefinition(), $marking));
78+
$options = array();
79+
$label = $input->getOption('label');
80+
if (null !== $label && '' !== trim($label)) {
81+
$options = array('graph' => array('label' => $label));
82+
}
83+
$output->writeln($dumper->dump($workflow->getDefinition(), $marking, $options));
7784
}
7885
}

0 commit comments

Comments
 (0)
0