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/Components/DependencyInjection/Fixtures/xml/services9.xml
Fabien Potencier 8d067bac51 [DepedencyInjection] amended previous commit
* fixed coding standards
 * made class optional as it is not defined when using a factory service
 * renamed factory attributes in XML files, updated XSD
 * removed the factory-class as it does nothing more than the regular class attribute
 * moved usage of Reflection as 'class' is not defined when a factory-service is used
 * added more tests
 * fixed PHP dumper
2010-07-05 11:08:56 +02:00

60 lines
2.2 KiB
XML

<?xml version="1.0" ?>
<container xmlns="http://www.symfony-project.org/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="baz_class">BazClass</parameter>
<parameter key="foo_class">FooClass</parameter>
<parameter key="foo">bar</parameter>
</parameters>
<services>
<service id="foo" class="FooClass" factory-method="getInstance" shared="false">
<annotation name="foo" foo="foo" />
<annotation name="foo" bar="bar" />
<file>%path%foo.php</file>
<argument>foo</argument>
<argument type="service" id="foo.baz" />
<argument type="collection">
<argument key="%foo%">foo is %foo%</argument>
<argument key="bar">%foo%</argument>
</argument>
<argument>true</argument>
<argument type="service" id="service_container" />
<call method="setBar">
<argument>bar</argument>
</call>
<call method="initialize" />
<configurator function="sc_configure" />
</service>
<service id="bar" class="FooClass">
<argument>foo</argument>
<argument type="service" id="foo.baz" />
<argument>%foo_bar%</argument>
<configurator service="foo.baz" method="configure" />
</service>
<service id="foo.baz" class="%baz_class%" factory-method="getInstance">
<configurator class="%baz_class%" method="configureStatic1" />
</service>
<service id="foo_bar" class="%foo_class%">
</service>
<service id="method_call1" class="FooClass">
<call method="setBar">
<argument type="service" id="foo" />
</call>
<call method="setBar">
<argument type="service" id="foo" on-invalid="null" />
</call>
<call method="setBar">
<argument type="service" id="foo" on-invalid="ignore" />
</call>
<call method="setBar">
<argument type="service" id="foobaz" on-invalid="ignore" />
</call>
</service>
<service id="factory_service" factory-method="getInstance" factory-service="foo.baz">
</service>
<service id="alias_for_foo" alias="foo" />
</services>
</container>