This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component/DependencyInjection/Fixtures/yaml/services9.yml
Fabien Potencier efed6005cb [DependencyInjection] fixed PHP dumper
In the dumped PHP class, we must use get() and not get*Service() methods to get services.
That's because all calls must be managed by get(). From the outside, you can call
get*Service() because as they are protected, they are caught by the __call() method;
which is not the case obviously when it is used internally.

If not, if you override a service with set(), this won't work when a service
depends on this one (the default one will still be used).
2010-11-12 17:38:32 +01:00

43 lines
997 B
YAML

parameters:
baz_class: BazClass
foo_class: FooClass
foo: bar
services:
foo:
class: FooClass
tags:
- { name: foo, foo: foo }
- { name: foo, bar: bar }
factory_method: getInstance
arguments: [foo, '@foo.baz', { '%foo%': 'foo is %foo%', bar: '%foo%' }, true, '@service_container']
calls:
- [setBar, ['@bar']]
- [initialize, { }]
shared: false
configurator: sc_configure
bar:
class: FooClass
arguments: [foo, '@foo.baz', '%foo_bar%']
configurator: ['@foo.baz', configure]
foo.baz:
class: %baz_class%
factory_method: getInstance
configurator: ['%baz_class%', configureStatic1]
foo_bar:
class: %foo_class%
method_call1:
class: FooClass
file: %path%foo.php
calls:
- [setBar, ['@foo']]
- [setBar, ['@@foo']]
- [setBar, ['@@foo']]
- [setBar, ['@@foobaz']]
factory_service:
factory_method: getInstance
factory_service: foo.baz
alias_for_foo: @foo