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

Commit4788d19

Browse files
committed
[FrameworkBundle][Workflow] Attach the workflow's configuration to theworkflow tag
1 parent72c80dd commit4788d19

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

‎src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CHANGELOG
66

77
* Add native return type to`Translator` and to`Application::reset()`
88
* Deprecate the integration of Doctrine annotations, either uninstall the`doctrine/annotations` package or disable the integration by setting`framework.annotations` to`false`
9+
* Attach the workflow's configuration to the`workflow` tag
910

1011
6.3
1112
---

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
10341034
$workflowDefinition->replaceArgument(3,$name);
10351035
$workflowDefinition->replaceArgument(4,$workflow['events_to_dispatch']);
10361036

1037-
$workflowDefinition->addTag('workflow', ['name' =>$name]);
1037+
$workflowDefinition->addTag('workflow', ['name' =>$name,'config' =>$workflow]);
10381038
if ('workflow' ===$type) {
10391039
$workflowDefinition->addTag('workflow.workflow', ['name' =>$name]);
10401040
}elseif ('state_machine' ===$type) {

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
useSymfony\Component\DependencyInjection\Loader\ClosureLoader;
4646
useSymfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag;
4747
useSymfony\Component\DependencyInjection\Reference;
48+
useSymfony\Component\DependencyInjection\Tests\Compiler\D;
4849
useSymfony\Component\EventDispatcher\EventDispatcherInterface;
4950
useSymfony\Component\Finder\Finder;
5051
useSymfony\Component\Form\Form;
@@ -305,7 +306,12 @@ public function testWorkflows()
305306
$this->assertArrayHasKey('index_4',$args);
306307
$this->assertNull($args['index_4'],'Workflows has eventsToDispatch=null');
307308

308-
$this->assertSame(['workflow' => [['name' =>'article']],'workflow.workflow' => [['name' =>'article']]],$container->getDefinition('workflow.article')->getTags());
309+
$tags =$container->getDefinition('workflow.article')->getTags();
310+
$this->assertArrayHasKey('workflow',$tags);
311+
$this->assertArrayHasKey('workflow.workflow',$tags);
312+
$this->assertSame([['name' =>'article']],$tags['workflow.workflow']);
313+
$this->assertSame('article',$tags['workflow'][0]['name'] ??null);
314+
$this->assertSame('workflow',$tags['workflow'][0]['config']['type'] ??null);
309315

310316
$this->assertTrue($container->hasDefinition('workflow.article.definition'),'Workflow definition is registered as a service');
311317

@@ -336,7 +342,12 @@ public function testWorkflows()
336342
$this->assertSame('state_machine.abstract',$container->getDefinition('state_machine.pull_request')->getParent());
337343
$this->assertTrue($container->hasDefinition('state_machine.pull_request.definition'),'State machine definition is registered as a service');
338344

339-
$this->assertSame(['workflow' => [['name' =>'pull_request']],'workflow.state_machine' => [['name' =>'pull_request']]],$container->getDefinition('state_machine.pull_request')->getTags());
345+
$tags =$container->getDefinition('state_machine.pull_request')->getTags();
346+
$this->assertArrayHasKey('workflow',$tags);
347+
$this->assertArrayHasKey('workflow.state_machine',$tags);
348+
$this->assertSame([['name' =>'pull_request']],$tags['workflow.state_machine']);
349+
$this->assertSame('pull_request',$tags['workflow'][0]['name'] ??null);
350+
$this->assertSame('state_machine',$tags['workflow'][0]['config']['type'] ??null);
340351

341352
$stateMachineDefinition =$container->getDefinition('state_machine.pull_request.definition');
342353

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp