Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0e9c70f

Browse files
[FrameworkBundle] Fix logic in workflow:dump between workflow name and workflow id
1 parentd7ea3de commit0e9c70f

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,27 @@ protected function configure()
7979
*/
8080
protectedfunctionexecute(InputInterface$input,OutputInterface$output):int
8181
{
82-
$workflowId =$input->getArgument('name');
82+
$workflowName =$input->getArgument('name');
8383

84-
if (!\in_array($workflowId,array_keys($this->workflows),true)) {
85-
thrownewInvalidArgumentException(sprintf('No service found for "workflow.%1$s" nor "state_machine.%1$s".',$workflowId));
84+
$workflow =null;
85+
86+
$workflowId ='workflow.' .$workflowName;
87+
if (\in_array($workflowId,array_keys($this->workflows),true)) {
88+
$workflow =$this->workflows[$workflowId];
89+
$type ='workflow';
8690
}
8791

88-
$type =explode('.',$workflowId)[0];
92+
if (!$workflow) {
93+
$workflowId ='state_machine.' .$workflowName;
94+
if (\in_array($workflowId,array_keys($this->workflows),true)) {
95+
$workflow =$this->workflows[$workflowId];
96+
$type ='state_machine';
97+
}
98+
}
99+
100+
if (null ===$workflow) {
101+
thrownewInvalidArgumentException(sprintf('No service found for "workflow.%1$s" nor "state_machine.%1$s".',$workflowName));
102+
}
89103

90104
switch ($input->getOption('dump-format')) {
91105
case'puml':
@@ -109,8 +123,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
109123
$marking->mark($place);
110124
}
111125

112-
$workflow =$this->workflows[$workflowId];
113-
114126
$options = [
115127
'name' =>$workflowId,
116128
'nofooter' =>true,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp