Skip to content

Commit 26f9bbb

Browse files
bug #61912 [FrameworkBundle] Fix support of dumping workflow when workflow is decorated by TraceableWorkflow (lyrixx)
This PR was merged into the 7.3 branch. Discussion ---------- [FrameworkBundle] Fix support of dumping workflow when workflow is decorated by TraceableWorkflow | Q | A | ------------- | --- | Branch? | 7.3 (the bug is not on 6.4, it has been introduced by 6baa3d2) | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #60215 | License | MIT Commits ------- c035ec4 [FrameworkBundle] Fix support of dumping workflow when workflow is decorated by TraceableWorkflow
2 parents 5ad28f9 + c035ec4 commit 26f9bbb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Symfony\Component\Console\Input\InputOption;
2222
use Symfony\Component\Console\Output\OutputInterface;
2323
use Symfony\Component\DependencyInjection\ServiceLocator;
24+
use Symfony\Component\Workflow\Debug\TraceableWorkflow;
2425
use Symfony\Component\Workflow\Dumper\GraphvizDumper;
2526
use Symfony\Component\Workflow\Dumper\MermaidDumper;
2627
use Symfony\Component\Workflow\Dumper\PlantUmlDumper;
@@ -78,6 +79,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7879
throw new InvalidArgumentException(\sprintf('The workflow named "%s" cannot be found.', $workflowName));
7980
}
8081
$workflow = $this->workflows->get($workflowName);
82+
if ($workflow instanceof TraceableWorkflow) {
83+
$workflow = $workflow->getInner();
84+
}
8185
$type = $workflow instanceof StateMachine ? 'state_machine' : 'workflow';
8286
$definition = $workflow->getDefinition();
8387

src/Symfony/Component/Workflow/Debug/TraceableWorkflow.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ public function getCalls(): array
8989
return $this->calls;
9090
}
9191

92+
public function getInner(): WorkflowInterface
93+
{
94+
return $this->workflow;
95+
}
96+
9297
private function callInner(string $method, array $args): mixed
9398
{
9499
if ($this->disabled?->__invoke()) {

0 commit comments

Comments
 (0)