[DependencyInjection] make the service container builder register the definition of its related service container service (and aliases) in order to make compiler passes be able to reference the special service_container service.
This commit is contained in:
parent
e7a9f03bae
commit
9c97496b5f
@ -40,10 +40,6 @@
|
|||||||
<argument type="collection" />
|
<argument type="collection" />
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service id="Psr\Container\ContainerInterface" alias="service_container" public="false" />
|
|
||||||
<service id="Symfony\Component\DependencyInjection\ContainerInterface" alias="service_container" public="false" />
|
|
||||||
<service id="Symfony\Component\DependencyInjection\Container" alias="service_container" public="false" />
|
|
||||||
|
|
||||||
<service id="kernel" synthetic="true" />
|
<service id="kernel" synthetic="true" />
|
||||||
|
|
||||||
<service id="filesystem" class="Symfony\Component\Filesystem\Filesystem" />
|
<service id="filesystem" class="Symfony\Component\Filesystem\Filesystem" />
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\DependencyInjection;
|
namespace Symfony\Component\DependencyInjection;
|
||||||
|
|
||||||
|
use Psr\Container\ContainerInterface as PsrContainerInterface;
|
||||||
use Symfony\Component\DependencyInjection\Argument\ClosureProxyArgument;
|
use Symfony\Component\DependencyInjection\Argument\ClosureProxyArgument;
|
||||||
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
|
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
|
||||||
use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
|
use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
|
||||||
@ -38,6 +39,7 @@ use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInt
|
|||||||
use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator;
|
use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator;
|
||||||
use Symfony\Component\DependencyInjection\LazyProxy\InheritanceProxyHelper;
|
use Symfony\Component\DependencyInjection\LazyProxy\InheritanceProxyHelper;
|
||||||
use Symfony\Component\DependencyInjection\LazyProxy\InheritanceProxyInterface;
|
use Symfony\Component\DependencyInjection\LazyProxy\InheritanceProxyInterface;
|
||||||
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||||
use Symfony\Component\ExpressionLanguage\Expression;
|
use Symfony\Component\ExpressionLanguage\Expression;
|
||||||
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
|
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
|
||||||
|
|
||||||
@ -117,6 +119,16 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||||||
*/
|
*/
|
||||||
private $vendors;
|
private $vendors;
|
||||||
|
|
||||||
|
public function __construct(ParameterBagInterface $parameterBag = null)
|
||||||
|
{
|
||||||
|
parent::__construct($parameterBag);
|
||||||
|
|
||||||
|
$this->setDefinition('service_container', (new Definition(ContainerInterface::class))->setSynthetic(true));
|
||||||
|
$this->setAlias(PsrContainerInterface::class, new Alias('service_container', false));
|
||||||
|
$this->setAlias(ContainerInterface::class, new Alias('service_container', false));
|
||||||
|
$this->setAlias(Container::class, new Alias('service_container', false));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the track resources flag.
|
* Sets the track resources flag.
|
||||||
*
|
*
|
||||||
|
@ -15,6 +15,7 @@ require_once __DIR__.'/Fixtures/includes/classes.php';
|
|||||||
require_once __DIR__.'/Fixtures/includes/ProjectExtension.php';
|
require_once __DIR__.'/Fixtures/includes/ProjectExtension.php';
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Psr\Container\ContainerInterface as PsrContainerInterface;
|
||||||
use Symfony\Component\Config\Resource\ComposerResource;
|
use Symfony\Component\Config\Resource\ComposerResource;
|
||||||
use Symfony\Component\Config\Resource\ResourceInterface;
|
use Symfony\Component\Config\Resource\ResourceInterface;
|
||||||
use Symfony\Component\Config\Resource\DirectoryResource;
|
use Symfony\Component\Config\Resource\DirectoryResource;
|
||||||
@ -25,6 +26,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
|
|||||||
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
|
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
|
||||||
use Symfony\Component\DependencyInjection\ChildDefinition;
|
use Symfony\Component\DependencyInjection\ChildDefinition;
|
||||||
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
|
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
|
||||||
|
use Symfony\Component\DependencyInjection\Container;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Component\DependencyInjection\Definition;
|
use Symfony\Component\DependencyInjection\Definition;
|
||||||
@ -42,6 +44,22 @@ use Symfony\Component\ExpressionLanguage\Expression;
|
|||||||
|
|
||||||
class ContainerBuilderTest extends TestCase
|
class ContainerBuilderTest extends TestCase
|
||||||
{
|
{
|
||||||
|
public function testDefaultRegisteredDefinitions()
|
||||||
|
{
|
||||||
|
$builder = new ContainerBuilder();
|
||||||
|
|
||||||
|
$this->assertCount(1, $builder->getDefinitions());
|
||||||
|
$this->assertTrue($builder->hasDefinition('service_container'));
|
||||||
|
|
||||||
|
$definition = $builder->getDefinition('service_container');
|
||||||
|
$this->assertInstanceOf(Definition::class, $definition);
|
||||||
|
$this->assertTrue($definition->isSynthetic());
|
||||||
|
$this->assertSame(ContainerInterface::class, $definition->getClass());
|
||||||
|
$this->assertTrue($builder->hasAlias(PsrContainerInterface::class));
|
||||||
|
$this->assertTrue($builder->hasAlias(ContainerInterface::class));
|
||||||
|
$this->assertTrue($builder->hasAlias(Container::class));
|
||||||
|
}
|
||||||
|
|
||||||
public function testDefinitions()
|
public function testDefinitions()
|
||||||
{
|
{
|
||||||
$builder = new ContainerBuilder();
|
$builder = new ContainerBuilder();
|
||||||
@ -203,7 +221,18 @@ class ContainerBuilderTest extends TestCase
|
|||||||
$builder->register('foo', 'stdClass');
|
$builder->register('foo', 'stdClass');
|
||||||
$builder->bar = $bar = new \stdClass();
|
$builder->bar = $bar = new \stdClass();
|
||||||
$builder->register('bar', 'stdClass');
|
$builder->register('bar', 'stdClass');
|
||||||
$this->assertEquals(array('foo', 'bar', 'service_container'), $builder->getServiceIds(), '->getServiceIds() returns all defined service ids');
|
$this->assertEquals(
|
||||||
|
array(
|
||||||
|
'service_container',
|
||||||
|
'foo',
|
||||||
|
'bar',
|
||||||
|
'Psr\Container\ContainerInterface',
|
||||||
|
'Symfony\Component\DependencyInjection\ContainerInterface',
|
||||||
|
'Symfony\Component\DependencyInjection\Container',
|
||||||
|
),
|
||||||
|
$builder->getServiceIds(),
|
||||||
|
'->getServiceIds() returns all defined service ids'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAliases()
|
public function testAliases()
|
||||||
@ -251,7 +280,7 @@ class ContainerBuilderTest extends TestCase
|
|||||||
|
|
||||||
$builder->set('foobar', 'stdClass');
|
$builder->set('foobar', 'stdClass');
|
||||||
$builder->set('moo', 'stdClass');
|
$builder->set('moo', 'stdClass');
|
||||||
$this->assertCount(0, $builder->getAliases(), '->getAliases() does not return aliased services that have been overridden');
|
$this->assertCount(3, $builder->getAliases(), '->getAliases() does not return aliased services that have been overridden');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSetAliases()
|
public function testSetAliases()
|
||||||
@ -538,7 +567,7 @@ class ContainerBuilderTest extends TestCase
|
|||||||
$config->setDefinition('baz', new Definition('BazClass'));
|
$config->setDefinition('baz', new Definition('BazClass'));
|
||||||
$config->setAlias('alias_for_foo', 'foo');
|
$config->setAlias('alias_for_foo', 'foo');
|
||||||
$container->merge($config);
|
$container->merge($config);
|
||||||
$this->assertEquals(array('foo', 'bar', 'baz'), array_keys($container->getDefinitions()), '->merge() merges definitions already defined ones');
|
$this->assertEquals(array('service_container', 'foo', 'bar', 'baz'), array_keys($container->getDefinitions()), '->merge() merges definitions already defined ones');
|
||||||
|
|
||||||
$aliases = $container->getAliases();
|
$aliases = $container->getAliases();
|
||||||
$this->assertTrue(isset($aliases['alias_for_foo']));
|
$this->assertTrue(isset($aliases['alias_for_foo']));
|
||||||
|
@ -70,6 +70,7 @@ class XmlDumperTest extends TestCase
|
|||||||
$this->assertEquals('<?xml version="1.0" encoding="utf-8"?>
|
$this->assertEquals('<?xml version="1.0" encoding="utf-8"?>
|
||||||
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
|
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
|
||||||
<services>
|
<services>
|
||||||
|
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerInterface" synthetic="true"/>
|
||||||
<service id="foo" class="FooClass">
|
<service id="foo" class="FooClass">
|
||||||
<argument type="service">
|
<argument type="service">
|
||||||
<service class="BarClass">
|
<service class="BarClass">
|
||||||
@ -79,6 +80,9 @@ class XmlDumperTest extends TestCase
|
|||||||
</service>
|
</service>
|
||||||
</argument>
|
</argument>
|
||||||
</service>
|
</service>
|
||||||
|
<service id="Psr\Container\ContainerInterface" alias="service_container" public="false"/>
|
||||||
|
<service id="Symfony\Component\DependencyInjection\ContainerInterface" alias="service_container" public="false"/>
|
||||||
|
<service id="Symfony\Component\DependencyInjection\Container" alias="service_container" public="false"/>
|
||||||
</services>
|
</services>
|
||||||
</container>
|
</container>
|
||||||
', $dumper->dump());
|
', $dumper->dump());
|
||||||
@ -91,10 +95,14 @@ class XmlDumperTest extends TestCase
|
|||||||
$this->assertEquals("<?xml version=\"1.0\" encoding=\"utf-8\"?>
|
$this->assertEquals("<?xml version=\"1.0\" encoding=\"utf-8\"?>
|
||||||
<container xmlns=\"http://symfony.com/schema/dic/services\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd\">
|
<container xmlns=\"http://symfony.com/schema/dic/services\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd\">
|
||||||
<services>
|
<services>
|
||||||
|
<service id=\"service_container\" class=\"Symfony\Component\DependencyInjection\ContainerInterface\" synthetic=\"true\"/>
|
||||||
<service id=\"foo\" class=\"FooClass\Foo\">
|
<service id=\"foo\" class=\"FooClass\Foo\">
|
||||||
<tag name=\"foo"bar\bar\" foo=\"foo"barřž€\"/>
|
<tag name=\"foo"bar\bar\" foo=\"foo"barřž€\"/>
|
||||||
<argument>foo<>&bar</argument>
|
<argument>foo<>&bar</argument>
|
||||||
</service>
|
</service>
|
||||||
|
<service id=\"Psr\Container\ContainerInterface\" alias=\"service_container\" public=\"false\"/>
|
||||||
|
<service id=\"Symfony\Component\DependencyInjection\ContainerInterface\" alias=\"service_container\" public=\"false\"/>
|
||||||
|
<service id=\"Symfony\Component\DependencyInjection\Container\" alias=\"service_container\" public=\"false\"/>
|
||||||
</services>
|
</services>
|
||||||
</container>
|
</container>
|
||||||
", $dumper->dump());
|
", $dumper->dump());
|
||||||
@ -117,14 +125,22 @@ class XmlDumperTest extends TestCase
|
|||||||
array("<?xml version=\"1.0\" encoding=\"utf-8\"?>
|
array("<?xml version=\"1.0\" encoding=\"utf-8\"?>
|
||||||
<container xmlns=\"http://symfony.com/schema/dic/services\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd\">
|
<container xmlns=\"http://symfony.com/schema/dic/services\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd\">
|
||||||
<services>
|
<services>
|
||||||
|
<service id=\"service_container\" class=\"Symfony\Component\DependencyInjection\ContainerInterface\" synthetic=\"true\"/>
|
||||||
<service id=\"foo\" class=\"FooClass\Foo\" decorates=\"bar\" decoration-inner-name=\"bar.woozy\"/>
|
<service id=\"foo\" class=\"FooClass\Foo\" decorates=\"bar\" decoration-inner-name=\"bar.woozy\"/>
|
||||||
|
<service id=\"Psr\Container\ContainerInterface\" alias=\"service_container\" public=\"false\"/>
|
||||||
|
<service id=\"Symfony\Component\DependencyInjection\ContainerInterface\" alias=\"service_container\" public=\"false\"/>
|
||||||
|
<service id=\"Symfony\Component\DependencyInjection\Container\" alias=\"service_container\" public=\"false\"/>
|
||||||
</services>
|
</services>
|
||||||
</container>
|
</container>
|
||||||
", include $fixturesPath.'/containers/container15.php'),
|
", include $fixturesPath.'/containers/container15.php'),
|
||||||
array("<?xml version=\"1.0\" encoding=\"utf-8\"?>
|
array("<?xml version=\"1.0\" encoding=\"utf-8\"?>
|
||||||
<container xmlns=\"http://symfony.com/schema/dic/services\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd\">
|
<container xmlns=\"http://symfony.com/schema/dic/services\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd\">
|
||||||
<services>
|
<services>
|
||||||
|
<service id=\"service_container\" class=\"Symfony\Component\DependencyInjection\ContainerInterface\" synthetic=\"true\"/>
|
||||||
<service id=\"foo\" class=\"FooClass\Foo\" decorates=\"bar\"/>
|
<service id=\"foo\" class=\"FooClass\Foo\" decorates=\"bar\"/>
|
||||||
|
<service id=\"Psr\Container\ContainerInterface\" alias=\"service_container\" public=\"false\"/>
|
||||||
|
<service id=\"Symfony\Component\DependencyInjection\ContainerInterface\" alias=\"service_container\" public=\"false\"/>
|
||||||
|
<service id=\"Symfony\Component\DependencyInjection\Container\" alias=\"service_container\" public=\"false\"/>
|
||||||
</services>
|
</services>
|
||||||
</container>
|
</container>
|
||||||
", include $fixturesPath.'/containers/container16.php'),
|
", include $fixturesPath.'/containers/container16.php'),
|
||||||
|
@ -3,5 +3,5 @@ digraph sc {
|
|||||||
node [fontsize="11" fontname="Arial" shape="record"];
|
node [fontsize="11" fontname="Arial" shape="record"];
|
||||||
edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"];
|
edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"];
|
||||||
|
|
||||||
node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"];
|
node_service_container [label="service_container (Psr\Container\ContainerInterface, Symfony\Component\DependencyInjection\ContainerInterface, Symfony\Component\DependencyInjection\Container)\nSymfony\\Component\\DependencyInjection\\ContainerInterface\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@ digraph sc {
|
|||||||
node [fontsize="13" fontname="Verdana" shape="square"];
|
node [fontsize="13" fontname="Verdana" shape="square"];
|
||||||
edge [fontsize="12" fontname="Verdana" color="white" arrowhead="closed" arrowsize="1"];
|
edge [fontsize="12" fontname="Verdana" color="white" arrowhead="closed" arrowsize="1"];
|
||||||
|
|
||||||
|
node_service_container [label="service_container (Psr\Container\ContainerInterface, Symfony\Component\DependencyInjection\ContainerInterface, Symfony\Component\DependencyInjection\Container)\nSymfony\\Component\\DependencyInjection\\ContainerInterface\n", shape=square, fillcolor="grey", style="filled"];
|
||||||
node_foo [label="foo\nFooClass\n", shape=square, fillcolor="grey", style="filled"];
|
node_foo [label="foo\nFooClass\n", shape=square, fillcolor="grey", style="filled"];
|
||||||
node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=square, fillcolor="green", style="empty"];
|
|
||||||
node_bar [label="bar\n\n", shape=square, fillcolor="red", style="empty"];
|
node_bar [label="bar\n\n", shape=square, fillcolor="red", style="empty"];
|
||||||
node_foo -> node_bar [label="" style="filled"];
|
node_foo -> node_bar [label="" style="filled"];
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@ digraph sc {
|
|||||||
node [fontsize="11" fontname="Arial" shape="record"];
|
node [fontsize="11" fontname="Arial" shape="record"];
|
||||||
edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"];
|
edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"];
|
||||||
|
|
||||||
|
node_service_container [label="service_container (Psr\Container\ContainerInterface, Symfony\Component\DependencyInjection\ContainerInterface, Symfony\Component\DependencyInjection\Container)\nSymfony\\Component\\DependencyInjection\\ContainerInterface\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
node_foo [label="foo\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
node_foo [label="foo\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"];
|
|
||||||
node_bar [label="bar\n\n", shape=record, fillcolor="#ff9999", style="filled"];
|
node_bar [label="bar\n\n", shape=record, fillcolor="#ff9999", style="filled"];
|
||||||
node_foo -> node_bar [label="" style="filled"];
|
node_foo -> node_bar [label="" style="filled"];
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@ digraph sc {
|
|||||||
node [fontsize="11" fontname="Arial" shape="record"];
|
node [fontsize="11" fontname="Arial" shape="record"];
|
||||||
edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"];
|
edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"];
|
||||||
|
|
||||||
|
node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerInterface\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
node_foo [label="foo\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
node_foo [label="foo\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
node_bar [label="bar\nBarClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
node_bar [label="bar\nBarClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"];
|
|
||||||
node_foo -> node_bar [label="" style="filled"];
|
node_foo -> node_bar [label="" style="filled"];
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,5 @@ digraph sc {
|
|||||||
node [fontsize="11" fontname="Arial" shape="record"];
|
node [fontsize="11" fontname="Arial" shape="record"];
|
||||||
edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"];
|
edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"];
|
||||||
|
|
||||||
node_service_container [label="service_container\nContainer14\\ProjectServiceContainer\n", shape=record, fillcolor="#9999ff", style="filled"];
|
node_service_container [label="service_container (Psr\Container\ContainerInterface, Symfony\Component\DependencyInjection\ContainerInterface, Symfony\Component\DependencyInjection\Container)\nSymfony\\Component\\DependencyInjection\\ContainerInterface\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,6 @@ digraph sc {
|
|||||||
node [fontsize="11" fontname="Arial" shape="record"];
|
node [fontsize="11" fontname="Arial" shape="record"];
|
||||||
edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"];
|
edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"];
|
||||||
|
|
||||||
|
node_service_container [label="service_container (Psr\Container\ContainerInterface, Symfony\Component\DependencyInjection\ContainerInterface, Symfony\Component\DependencyInjection\Container)\nSymfony\\Component\\DependencyInjection\\ContainerInterface\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
node_foo [label="foo\n%foo.class%\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
node_foo [label="foo\n%foo.class%\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"];
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ digraph sc {
|
|||||||
node [fontsize="11" fontname="Arial" shape="record"];
|
node [fontsize="11" fontname="Arial" shape="record"];
|
||||||
edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"];
|
edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"];
|
||||||
|
|
||||||
|
node_service_container [label="service_container (Psr\Container\ContainerInterface, Symfony\Component\DependencyInjection\ContainerInterface, Symfony\Component\DependencyInjection\Container)\nSymfony\\Component\\DependencyInjection\\ContainerInterface\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
node_foo [label="foo (alias_for_foo)\nBar\\FooClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
node_foo [label="foo (alias_for_foo)\nBar\\FooClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
node_foo_baz [label="foo.baz\nBazClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
node_foo_baz [label="foo.baz\nBazClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
node_bar [label="bar\nBar\\FooClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
node_bar [label="bar\nBar\\FooClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
@ -30,7 +31,6 @@ digraph sc {
|
|||||||
node_lazy_context_ignore_invalid_ref [label="lazy_context_ignore_invalid_ref\nLazyContext\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
node_lazy_context_ignore_invalid_ref [label="lazy_context_ignore_invalid_ref\nLazyContext\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
node_closure_proxy [label="closure_proxy\nBarClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
node_closure_proxy [label="closure_proxy\nBarClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
node_service_locator [label="service_locator\nBar\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
node_service_locator [label="service_locator\nBar\n", shape=record, fillcolor="#eeeeee", style="filled"];
|
||||||
node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"];
|
|
||||||
node_foo2 [label="foo2\n\n", shape=record, fillcolor="#ff9999", style="filled"];
|
node_foo2 [label="foo2\n\n", shape=record, fillcolor="#ff9999", style="filled"];
|
||||||
node_foo3 [label="foo3\n\n", shape=record, fillcolor="#ff9999", style="filled"];
|
node_foo3 [label="foo3\n\n", shape=record, fillcolor="#ff9999", style="filled"];
|
||||||
node_foobaz [label="foobaz\n\n", shape=record, fillcolor="#ff9999", style="filled"];
|
node_foobaz [label="foobaz\n\n", shape=record, fillcolor="#ff9999", style="filled"];
|
||||||
|
@ -29,6 +29,11 @@ class Container extends AbstractContainer
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
|
|
||||||
$this->aliases = array();
|
$this->aliases = array();
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,11 @@ class ProjectServiceContainer extends Container
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
|
|
||||||
$this->aliases = array();
|
$this->aliases = array();
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,11 @@ class ProjectServiceContainer extends Container
|
|||||||
$this->parameters = $this->getDefaultParameters();
|
$this->parameters = $this->getDefaultParameters();
|
||||||
|
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
'test' => 'getTestService',
|
'test' => 'getTestService',
|
||||||
);
|
);
|
||||||
|
@ -34,6 +34,11 @@ class ProjectServiceContainer extends Container
|
|||||||
$this->parameters = $this->getDefaultParameters();
|
$this->parameters = $this->getDefaultParameters();
|
||||||
|
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
'test' => 'getTestService',
|
'test' => 'getTestService',
|
||||||
);
|
);
|
||||||
|
@ -28,6 +28,11 @@ class ProjectServiceContainer extends Container
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
'bar' => 'getBarService',
|
'bar' => 'getBarService',
|
||||||
);
|
);
|
||||||
|
@ -28,6 +28,11 @@ class ProjectServiceContainer extends Container
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
'service_from_anonymous_factory' => 'getServiceFromAnonymousFactoryService',
|
'service_from_anonymous_factory' => 'getServiceFromAnonymousFactoryService',
|
||||||
'service_with_method_call_and_factory' => 'getServiceWithMethodCallAndFactoryService',
|
'service_with_method_call_and_factory' => 'getServiceWithMethodCallAndFactoryService',
|
||||||
|
@ -28,6 +28,11 @@ class ProjectServiceContainer extends Container
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
'foo' => 'getFooService',
|
'foo' => 'getFooService',
|
||||||
);
|
);
|
||||||
|
@ -30,6 +30,11 @@ class ProjectServiceContainer extends Container
|
|||||||
$this->parameters = $this->getDefaultParameters();
|
$this->parameters = $this->getDefaultParameters();
|
||||||
|
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
'test' => 'getTestService',
|
'test' => 'getTestService',
|
||||||
);
|
);
|
||||||
|
@ -28,6 +28,11 @@ class Symfony_DI_PhpDumper_Test_Overriden_Getters extends Container
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
'baz' => 'getBazService',
|
'baz' => 'getBazService',
|
||||||
'foo' => 'getFooService',
|
'foo' => 'getFooService',
|
||||||
|
@ -28,6 +28,11 @@ class ProjectServiceContainer extends Container
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
'bar' => 'getBarService',
|
'bar' => 'getBarService',
|
||||||
'foo' => 'getFooService',
|
'foo' => 'getFooService',
|
||||||
|
@ -28,6 +28,11 @@ class ProjectServiceContainer extends Container
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
'bar' => 'getBarService',
|
'bar' => 'getBarService',
|
||||||
'foo' => 'getFooService',
|
'foo' => 'getFooService',
|
||||||
|
@ -29,6 +29,9 @@ class ProjectServiceContainer extends Container
|
|||||||
{
|
{
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
$this->normalizedIds = array(
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
'symfony\\component\\dependencyinjection\\tests\\fixtures\\container33\\foo' => 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\Container33\\Foo',
|
'symfony\\component\\dependencyinjection\\tests\\fixtures\\container33\\foo' => 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\Container33\\Foo',
|
||||||
);
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
|
@ -30,6 +30,11 @@ class ProjectServiceContainer extends Container
|
|||||||
$this->parameters = $this->getDefaultParameters();
|
$this->parameters = $this->getDefaultParameters();
|
||||||
|
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
|
|
||||||
$this->aliases = array();
|
$this->aliases = array();
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,11 @@ class ProjectServiceContainer extends Container
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct(new ParameterBag($this->getDefaultParameters()));
|
parent::__construct(new ParameterBag($this->getDefaultParameters()));
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
'bar' => 'getBarService',
|
'bar' => 'getBarService',
|
||||||
'baz' => 'getBazService',
|
'baz' => 'getBazService',
|
||||||
@ -64,6 +69,9 @@ class ProjectServiceContainer extends Container
|
|||||||
'new_factory' => true,
|
'new_factory' => true,
|
||||||
);
|
);
|
||||||
$this->aliases = array(
|
$this->aliases = array(
|
||||||
|
'Psr\\Container\\ContainerInterface' => 'service_container',
|
||||||
|
'Symfony\\Component\\DependencyInjection\\Container' => 'service_container',
|
||||||
|
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => 'service_container',
|
||||||
'alias_for_alias' => 'foo',
|
'alias_for_alias' => 'foo',
|
||||||
'alias_for_foo' => 'foo',
|
'alias_for_foo' => 'foo',
|
||||||
);
|
);
|
||||||
|
@ -30,6 +30,11 @@ class ProjectServiceContainer extends Container
|
|||||||
$this->parameters = $this->getDefaultParameters();
|
$this->parameters = $this->getDefaultParameters();
|
||||||
|
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
'bar' => 'getBarService',
|
'bar' => 'getBarService',
|
||||||
'baz' => 'getBazService',
|
'baz' => 'getBazService',
|
||||||
|
@ -28,6 +28,11 @@ class Symfony_DI_PhpDumper_Test_Overriden_Getters_With_Constructor extends Conta
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
'baz' => 'getBazService',
|
'baz' => 'getBazService',
|
||||||
'foo' => 'getFooService',
|
'foo' => 'getFooService',
|
||||||
|
@ -28,6 +28,11 @@ class Symfony_DI_PhpDumper_Test_Locator_Argument_Provide_Service_Locator extends
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->services = array();
|
$this->services = array();
|
||||||
|
$this->normalizedIds = array(
|
||||||
|
'psr\\container\\containerinterface' => 'Psr\\Container\\ContainerInterface',
|
||||||
|
'symfony\\component\\dependencyinjection\\container' => 'Symfony\\Component\\DependencyInjection\\Container',
|
||||||
|
'symfony\\component\\dependencyinjection\\containerinterface' => 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
|
||||||
|
);
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
'lazy_context' => 'getLazyContextService',
|
'lazy_context' => 'getLazyContextService',
|
||||||
'lazy_referenced' => 'getLazyReferencedService',
|
'lazy_referenced' => 'getLazyReferencedService',
|
||||||
|
@ -1,2 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"/>
|
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
|
||||||
|
<services>
|
||||||
|
<service class="Symfony\Component\DependencyInjection\ContainerInterface" id="service_container" synthetic="true"/>
|
||||||
|
<service alias="service_container" id="Psr\Container\ContainerInterface" public="false"/>
|
||||||
|
<service alias="service_container" id="Symfony\Component\DependencyInjection\ContainerInterface" public="false"/>
|
||||||
|
<service alias="service_container" id="Symfony\Component\DependencyInjection\Container" public="false"/>
|
||||||
|
</services>
|
||||||
|
</container>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
|
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
|
||||||
<services>
|
<services>
|
||||||
|
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerInterface" synthetic="true"/>
|
||||||
<service id="foo" class="Foo">
|
<service id="foo" class="Foo">
|
||||||
<factory method="createFoo">
|
<factory method="createFoo">
|
||||||
<service class="FooFactory">
|
<service class="FooFactory">
|
||||||
@ -17,5 +18,8 @@
|
|||||||
</service>
|
</service>
|
||||||
</configurator>
|
</configurator>
|
||||||
</service>
|
</service>
|
||||||
|
<service id="Psr\Container\ContainerInterface" alias="service_container" public="false"/>
|
||||||
|
<service id="Symfony\Component\DependencyInjection\ContainerInterface" alias="service_container" public="false"/>
|
||||||
|
<service id="Symfony\Component\DependencyInjection\Container" alias="service_container" public="false"/>
|
||||||
</services>
|
</services>
|
||||||
</container>
|
</container>
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
|
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
|
||||||
<services>
|
<services>
|
||||||
|
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerInterface" synthetic="true"/>
|
||||||
<service id="foo" class="Foo" autowire="true"/>
|
<service id="foo" class="Foo" autowire="true"/>
|
||||||
|
<service id="Psr\Container\ContainerInterface" alias="service_container" public="false"/>
|
||||||
|
<service id="Symfony\Component\DependencyInjection\ContainerInterface" alias="service_container" public="false"/>
|
||||||
|
<service id="Symfony\Component\DependencyInjection\Container" alias="service_container" public="false"/>
|
||||||
</services>
|
</services>
|
||||||
</container>
|
</container>
|
||||||
|
@ -19,4 +19,10 @@
|
|||||||
<parameter type="string">null</parameter>
|
<parameter type="string">null</parameter>
|
||||||
</parameter>
|
</parameter>
|
||||||
</parameters>
|
</parameters>
|
||||||
|
<services>
|
||||||
|
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerInterface" synthetic="true"/>
|
||||||
|
<service id="Psr\Container\ContainerInterface" alias="service_container" public="false"/>
|
||||||
|
<service id="Symfony\Component\DependencyInjection\ContainerInterface" alias="service_container" public="false"/>
|
||||||
|
<service id="Symfony\Component\DependencyInjection\Container" alias="service_container" public="false"/>
|
||||||
|
</services>
|
||||||
</container>
|
</container>
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<parameter key="foo">bar</parameter>
|
<parameter key="foo">bar</parameter>
|
||||||
</parameters>
|
</parameters>
|
||||||
<services>
|
<services>
|
||||||
|
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerInterface" synthetic="true"/>
|
||||||
<service id="foo" class="Bar\FooClass">
|
<service id="foo" class="Bar\FooClass">
|
||||||
<tag name="foo" foo="foo"/>
|
<tag name="foo" foo="foo"/>
|
||||||
<tag name="foo" bar="bar" baz="baz"/>
|
<tag name="foo" bar="bar" baz="baz"/>
|
||||||
@ -143,6 +144,9 @@
|
|||||||
<argument key="container" type="service" id="service_container"/>
|
<argument key="container" type="service" id="service_container"/>
|
||||||
</argument>
|
</argument>
|
||||||
</service>
|
</service>
|
||||||
|
<service id="Psr\Container\ContainerInterface" alias="service_container" public="false"/>
|
||||||
|
<service id="Symfony\Component\DependencyInjection\ContainerInterface" alias="service_container" public="false"/>
|
||||||
|
<service id="Symfony\Component\DependencyInjection\Container" alias="service_container" public="false"/>
|
||||||
<service id="alias_for_foo" alias="foo"/>
|
<service id="alias_for_foo" alias="foo"/>
|
||||||
<service id="alias_for_alias" alias="foo"/>
|
<service id="alias_for_alias" alias="foo"/>
|
||||||
</services>
|
</services>
|
||||||
|
@ -1 +1,13 @@
|
|||||||
|
services:
|
||||||
|
service_container:
|
||||||
|
class: Symfony\Component\DependencyInjection\ContainerInterface
|
||||||
|
synthetic: true
|
||||||
|
Psr\Container\ContainerInterface:
|
||||||
|
alias: service_container
|
||||||
|
public: false
|
||||||
|
Symfony\Component\DependencyInjection\ContainerInterface:
|
||||||
|
alias: service_container
|
||||||
|
public: false
|
||||||
|
Symfony\Component\DependencyInjection\Container:
|
||||||
|
alias: service_container
|
||||||
|
public: false
|
||||||
|
@ -1,5 +1,17 @@
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
|
service_container:
|
||||||
|
class: Symfony\Component\DependencyInjection\ContainerInterface
|
||||||
|
synthetic: true
|
||||||
foo:
|
foo:
|
||||||
class: Foo
|
class: Foo
|
||||||
autowire: true
|
autowire: true
|
||||||
|
Psr\Container\ContainerInterface:
|
||||||
|
alias: service_container
|
||||||
|
public: false
|
||||||
|
Symfony\Component\DependencyInjection\ContainerInterface:
|
||||||
|
alias: service_container
|
||||||
|
public: false
|
||||||
|
Symfony\Component\DependencyInjection\Container:
|
||||||
|
alias: service_container
|
||||||
|
public: false
|
||||||
|
@ -5,3 +5,16 @@ parameters:
|
|||||||
escape: '@@escapeme'
|
escape: '@@escapeme'
|
||||||
values: [true, false, null, 0, 1000.3, 'true', 'false', 'null']
|
values: [true, false, null, 0, 1000.3, 'true', 'false', 'null']
|
||||||
|
|
||||||
|
services:
|
||||||
|
service_container:
|
||||||
|
class: Symfony\Component\DependencyInjection\ContainerInterface
|
||||||
|
synthetic: true
|
||||||
|
Psr\Container\ContainerInterface:
|
||||||
|
alias: service_container
|
||||||
|
public: false
|
||||||
|
Symfony\Component\DependencyInjection\ContainerInterface:
|
||||||
|
alias: service_container
|
||||||
|
public: false
|
||||||
|
Symfony\Component\DependencyInjection\Container:
|
||||||
|
alias: service_container
|
||||||
|
public: false
|
||||||
|
@ -4,6 +4,9 @@ parameters:
|
|||||||
foo: bar
|
foo: bar
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
service_container:
|
||||||
|
class: Symfony\Component\DependencyInjection\ContainerInterface
|
||||||
|
synthetic: true
|
||||||
foo:
|
foo:
|
||||||
class: Bar\FooClass
|
class: Bar\FooClass
|
||||||
tags:
|
tags:
|
||||||
@ -121,3 +124,12 @@ services:
|
|||||||
service_locator:
|
service_locator:
|
||||||
class: Bar
|
class: Bar
|
||||||
arguments: [!service_locator { bar: '@bar', invalid: '@?invalid', container: '@service_container' }]
|
arguments: [!service_locator { bar: '@bar', invalid: '@?invalid', container: '@service_container' }]
|
||||||
|
Psr\Container\ContainerInterface:
|
||||||
|
alias: service_container
|
||||||
|
public: false
|
||||||
|
Symfony\Component\DependencyInjection\ContainerInterface:
|
||||||
|
alias: service_container
|
||||||
|
public: false
|
||||||
|
Symfony\Component\DependencyInjection\Container:
|
||||||
|
alias: service_container
|
||||||
|
public: false
|
||||||
|
@ -185,7 +185,7 @@ class XmlFileLoaderTest extends TestCase
|
|||||||
$loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml'));
|
$loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml'));
|
||||||
$loader->load('services5.xml');
|
$loader->load('services5.xml');
|
||||||
$services = $container->getDefinitions();
|
$services = $container->getDefinitions();
|
||||||
$this->assertCount(6, $services, '->load() attributes unique ids to anonymous services');
|
$this->assertCount(7, $services, '->load() attributes unique ids to anonymous services');
|
||||||
|
|
||||||
// anonymous service as an argument
|
// anonymous service as an argument
|
||||||
$args = $services['foo']->getArguments();
|
$args = $services['foo']->getArguments();
|
||||||
@ -485,11 +485,11 @@ class XmlFileLoaderTest extends TestCase
|
|||||||
$loader1 = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml/extension1'));
|
$loader1 = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml/extension1'));
|
||||||
$loader1->load('services.xml');
|
$loader1->load('services.xml');
|
||||||
$services = $container->getDefinitions();
|
$services = $container->getDefinitions();
|
||||||
$this->assertCount(2, $services, '->load() attributes unique ids to anonymous services');
|
$this->assertCount(3, $services, '->load() attributes unique ids to anonymous services');
|
||||||
$loader2 = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml/extension2'));
|
$loader2 = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml/extension2'));
|
||||||
$loader2->load('services.xml');
|
$loader2->load('services.xml');
|
||||||
$services = $container->getDefinitions();
|
$services = $container->getDefinitions();
|
||||||
$this->assertCount(4, $services, '->load() attributes unique ids to anonymous services');
|
$this->assertCount(5, $services, '->load() attributes unique ids to anonymous services');
|
||||||
|
|
||||||
$services = $container->getDefinitions();
|
$services = $container->getDefinitions();
|
||||||
$args1 = $services['extension1.foo']->getArguments();
|
$args1 = $services['extension1.foo']->getArguments();
|
||||||
@ -632,7 +632,7 @@ class XmlFileLoaderTest extends TestCase
|
|||||||
|
|
||||||
$ids = array_keys($container->getDefinitions());
|
$ids = array_keys($container->getDefinitions());
|
||||||
sort($ids);
|
sort($ids);
|
||||||
$this->assertSame(array(Prototype\Foo::class, Prototype\Sub\Bar::class), $ids);
|
$this->assertSame(array(Prototype\Foo::class, Prototype\Sub\Bar::class, 'service_container'), $ids);
|
||||||
|
|
||||||
$resources = $container->getResources();
|
$resources = $container->getResources();
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ class YamlFileLoaderTest extends TestCase
|
|||||||
|
|
||||||
$ids = array_keys($container->getDefinitions());
|
$ids = array_keys($container->getDefinitions());
|
||||||
sort($ids);
|
sort($ids);
|
||||||
$this->assertSame(array(Prototype\Foo::class, Prototype\Sub\Bar::class), $ids);
|
$this->assertSame(array(Prototype\Foo::class, Prototype\Sub\Bar::class, 'service_container'), $ids);
|
||||||
|
|
||||||
$resources = $container->getResources();
|
$resources = $container->getResources();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user