Skip to content

Commit c9c687e

Browse files
committed
merged branch palex-fpt/I-7542 (PR symfony#7595)
This PR was merged into the master branch. Discussion ---------- YamlDumper should dump Definition::$factoryClass setting It should fix symfony#7542 Commits ------- 77f00d2 YamlDumper should dump Definition::getFactoryClass() setting
2 parents 83e078a + 77f00d2 commit c9c687e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ private function addService($id, $definition)
102102
$code .= sprintf(" synchronized: true\n");
103103
}
104104

105+
if ($definition->getFactoryClass()) {
106+
$code .= sprintf(" factory_class: %s\n", $definition->getFactoryClass());
107+
}
108+
105109
if ($definition->getFactoryMethod()) {
106110
$code .= sprintf(" factory_method: %s\n", $definition->getFactoryMethod());
107111
}

src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ services:
99
tags:
1010
- { name: foo, foo: foo }
1111
- { name: foo, bar: bar }
12+
factory_class: FooClass
1213
factory_method: getInstance
1314
arguments: [foo, '@foo.baz', { '%foo%': 'foo is %foo%', foobar: '%foo%' }, true, '@service_container']
1415
properties: { foo: bar, moo: '@foo.baz' }
@@ -23,6 +24,7 @@ services:
2324
configurator: ['@foo.baz', configure]
2425
foo.baz:
2526
class: %baz_class%
27+
factory_class: %baz_class%
2628
factory_method: getInstance
2729
configurator: ['%baz_class%', configureStatic1]
2830
foo_bar:

0 commit comments

Comments
 (0)