[DI][FrameworkBundle] ServiceLocator: Tests dumpers & update descriptors
This commit is contained in:
parent
b5d9b3b99e
commit
aa9074d25a
@ -16,6 +16,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\DependencyInjection\Alias;
|
||||
use Symfony\Component\DependencyInjection\Argument\ClosureProxyArgument;
|
||||
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
|
||||
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||
@ -328,12 +329,14 @@ class TextDescriptor extends Descriptor
|
||||
} elseif ($argument instanceof Definition) {
|
||||
$argumentsInformation[] = 'Inlined Service';
|
||||
} elseif ($argument instanceof IteratorArgument) {
|
||||
$argumentsInformation[] = 'Iterator';
|
||||
$argumentsInformation[] = sprintf('Iterator (%d element(s))', count($argument->getValues()));
|
||||
} elseif ($argument instanceof ServiceLocatorArgument) {
|
||||
$argumentsInformation[] = sprintf('ServiceLocator (%d service(s))', count($argument->getValues()));
|
||||
} elseif ($argument instanceof ClosureProxyArgument) {
|
||||
list($reference, $method) = $argument->getValues();
|
||||
$argumentsInformation[] = sprintf('ClosureProxy(Service(%s)::%s())', $reference, $method);
|
||||
} else {
|
||||
$argumentsInformation[] = is_array($argument) ? 'Array' : $argument;
|
||||
$argumentsInformation[] = is_array($argument) ? sprintf('Array (%d element(s))', count($argument)) : $argument;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ namespace Symfony\Bundle\FrameworkBundle\Console\Descriptor;
|
||||
use Symfony\Component\DependencyInjection\Alias;
|
||||
use Symfony\Component\DependencyInjection\Argument\ClosureProxyArgument;
|
||||
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
|
||||
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||
@ -432,6 +433,12 @@ class XmlDescriptor extends Descriptor
|
||||
} elseif ($argument instanceof IteratorArgument) {
|
||||
$argumentXML->setAttribute('type', 'iterator');
|
||||
|
||||
foreach ($this->getArgumentNodes($argument->getValues(), $dom) as $childArgumentXML) {
|
||||
$argumentXML->appendChild($childArgumentXML);
|
||||
}
|
||||
} elseif ($argument instanceof ServiceLocatorArgument) {
|
||||
$argumentXML->setAttribute('type', 'service_locator');
|
||||
|
||||
foreach ($this->getArgumentNodes($argument->getValues(), $dom) as $childArgumentXML) {
|
||||
$argumentXML->appendChild($childArgumentXML);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor;
|
||||
use Symfony\Component\DependencyInjection\Alias;
|
||||
use Symfony\Component\DependencyInjection\Argument\ClosureProxyArgument;
|
||||
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
|
||||
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||
@ -120,6 +121,10 @@ class ObjectsProvider
|
||||
new Reference('definition_2'),
|
||||
)))
|
||||
->addArgument(new ClosureProxyArgument('definition1', 'get'))
|
||||
->addArgument(new ServiceLocatorArgument(array(
|
||||
'def1' => new Reference('definition_1'),
|
||||
'def2' => new Reference('definition_2'),
|
||||
)))
|
||||
->setFactory(array('Full\\Qualified\\FactoryClass', 'get')),
|
||||
'definition_2' => $definition2
|
||||
->setPublic(false)
|
||||
|
@ -64,7 +64,17 @@
|
||||
"id": "definition1"
|
||||
},
|
||||
"get"
|
||||
]
|
||||
],
|
||||
{
|
||||
"def1": {
|
||||
"type": "service",
|
||||
"id": "definition_1"
|
||||
},
|
||||
"def2": {
|
||||
"type": "service",
|
||||
"id": "definition_2"
|
||||
}
|
||||
}
|
||||
],
|
||||
"file": null,
|
||||
"factory_class": "Full\\Qualified\\FactoryClass",
|
||||
|
@ -24,6 +24,10 @@
|
||||
<argument type="service" id="definition_2"/>
|
||||
</argument>
|
||||
<argument type="closure-proxy" id="definition1" method="get"/>
|
||||
<argument type="service_locator">
|
||||
<argument key="def1" type="service" id="definition_1"/>
|
||||
<argument key="def2" type="service" id="definition_2"/>
|
||||
</argument>
|
||||
</definition>
|
||||
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerBuilder"/>
|
||||
</container>
|
||||
|
@ -62,7 +62,17 @@
|
||||
"id": "definition1"
|
||||
},
|
||||
"get"
|
||||
]
|
||||
],
|
||||
{
|
||||
"def1": {
|
||||
"type": "service",
|
||||
"id": "definition_1"
|
||||
},
|
||||
"def2": {
|
||||
"type": "service",
|
||||
"id": "definition_2"
|
||||
}
|
||||
}
|
||||
],
|
||||
"file": null,
|
||||
"factory_class": "Full\\Qualified\\FactoryClass",
|
||||
|
@ -15,8 +15,9 @@
|
||||
Arguments Service(definition2)
|
||||
%parameter%
|
||||
Inlined Service
|
||||
Array
|
||||
Iterator
|
||||
Array (3 element(s))
|
||||
Iterator (2 element(s))
|
||||
ClosureProxy(Service(definition1)::get())
|
||||
ServiceLocator (2 service(s))
|
||||
---------------- -------------------------------------------
|
||||
|
||||
|
@ -21,4 +21,8 @@
|
||||
<argument type="service" id="definition_2"/>
|
||||
</argument>
|
||||
<argument type="closure-proxy" id="definition1" method="get"/>
|
||||
<argument type="service_locator">
|
||||
<argument key="def1" type="service" id="definition_1"/>
|
||||
<argument key="def2" type="service" id="definition_2"/>
|
||||
</argument>
|
||||
</definition>
|
||||
|
@ -898,8 +898,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
$bagClass
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/*{$this->docStar}
|
||||
* $class.
|
||||
|
@ -5,6 +5,7 @@ require_once __DIR__.'/../includes/foo.php';
|
||||
|
||||
use Symfony\Component\DependencyInjection\Argument\ClosureProxyArgument;
|
||||
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
|
||||
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
@ -144,5 +145,13 @@ $container
|
||||
->register('closure_proxy', 'BarClass')
|
||||
->setArguments(array(new ClosureProxyArgument('closure_proxy', 'getBaz')))
|
||||
;
|
||||
$container
|
||||
->register('service_locator', 'Bar')
|
||||
->setArguments(array(new ServiceLocatorArgument(array(
|
||||
'bar' => new Reference('bar'),
|
||||
'invalid' => new Reference('invalid', ContainerInterface::IGNORE_ON_INVALID_REFERENCE),
|
||||
'container' => new Reference('service_container'),
|
||||
))))
|
||||
;
|
||||
|
||||
return $container;
|
||||
|
@ -29,6 +29,7 @@ digraph sc {
|
||||
node_lazy_context [label="lazy_context\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_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_foo3 [label="foo3\n\n", shape=record, fillcolor="#ff9999", style="filled"];
|
||||
@ -52,4 +53,7 @@ digraph sc {
|
||||
node_lazy_context_ignore_invalid_ref -> node_foo_baz [label="" style="filled" color="#9999ff"];
|
||||
node_lazy_context_ignore_invalid_ref -> node_invalid [label="" style="filled" color="#9999ff"];
|
||||
node_closure_proxy -> node_closure_proxy [label="" style="filled" color="#9999ff"];
|
||||
node_service_locator -> node_bar [label="" style="filled" color="#9999ff"];
|
||||
node_service_locator -> node_invalid [label="" style="filled" color="#9999ff"];
|
||||
node_service_locator -> node_service_container [label="" style="filled" color="#9999ff"];
|
||||
}
|
||||
|
@ -7,8 +7,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* Container.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* ProjectServiceContainer.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* ProjectServiceContainer.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* ProjectServiceContainer.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* ProjectServiceContainer.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* ProjectServiceContainer.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* ProjectServiceContainer.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* ProjectServiceContainer.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* Symfony_DI_PhpDumper_Test_Overriden_Getters.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* ProjectServiceContainer.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* ProjectServiceContainer.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* ProjectServiceContainer.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* ProjectServiceContainer.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* ProjectServiceContainer.
|
||||
@ -54,6 +54,7 @@ class ProjectServiceContainer extends Container
|
||||
'new_factory' => 'getNewFactoryService',
|
||||
'new_factory_service' => 'getNewFactoryServiceService',
|
||||
'service_from_static_method' => 'getServiceFromStaticMethodService',
|
||||
'service_locator' => 'getServiceLocatorService',
|
||||
);
|
||||
$this->privates = array(
|
||||
'configurator_service' => true,
|
||||
@ -401,6 +402,23 @@ class ProjectServiceContainer extends Container
|
||||
return $this->services['service_from_static_method'] = \Bar\FooClass::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the 'service_locator' service.
|
||||
*
|
||||
* This service is shared.
|
||||
* This method always returns the same instance of the service.
|
||||
*
|
||||
* @return \Bar A Bar instance
|
||||
*/
|
||||
protected function getServiceLocatorService()
|
||||
{
|
||||
return $this->services['service_locator'] = new \Bar(new ServiceLocator(array(
|
||||
'bar' => function () { return ${($_ = isset($this->services['bar']) ? $this->services['bar'] : $this->get('bar')) && false ?: '_'}; },
|
||||
'invalid' => function () { return $this->get('invalid', ContainerInterface::NULL_ON_INVALID_REFERENCE); },
|
||||
'container' => function () { return $this; },
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the 'configurator_service' service.
|
||||
*
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* ProjectServiceContainer.
|
||||
@ -50,6 +50,7 @@ class ProjectServiceContainer extends Container
|
||||
'method_call1' => 'getMethodCall1Service',
|
||||
'new_factory_service' => 'getNewFactoryServiceService',
|
||||
'service_from_static_method' => 'getServiceFromStaticMethodService',
|
||||
'service_locator' => 'getServiceLocatorService',
|
||||
);
|
||||
$this->aliases = array(
|
||||
'alias_for_alias' => 'foo',
|
||||
@ -392,6 +393,22 @@ class ProjectServiceContainer extends Container
|
||||
return $this->services['service_from_static_method'] = \Bar\FooClass::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the 'service_locator' service.
|
||||
*
|
||||
* This service is shared.
|
||||
* This method always returns the same instance of the service.
|
||||
*
|
||||
* @return \Bar A Bar instance
|
||||
*/
|
||||
protected function getServiceLocatorService()
|
||||
{
|
||||
return $this->services['service_locator'] = new \Bar(new ServiceLocator(array(
|
||||
'bar' => function () { return ${($_ = isset($this->services['bar']) ? $this->services['bar'] : $this->get('bar')) && false ?: '_'}; },
|
||||
'container' => function () { return $this; },
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* Symfony_DI_PhpDumper_Test_Overriden_Getters_With_Constructor.
|
||||
|
@ -6,8 +6,8 @@ use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Exception\LogicException;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
|
||||
/**
|
||||
* Symfony_DI_PhpDumper_Test_Locator_Argument_Provide_Service_Locator.
|
||||
|
@ -136,6 +136,13 @@
|
||||
<service id="closure_proxy" class="BarClass">
|
||||
<argument type="closure-proxy" id="closure_proxy" method="getBaz"/>
|
||||
</service>
|
||||
<service id="service_locator" class="Bar">
|
||||
<argument type="service-locator">
|
||||
<argument key="bar" type="service" id="bar"/>
|
||||
<argument key="invalid" type="service" id="invalid" on-invalid="ignore"/>
|
||||
<argument key="container" type="service" id="service_container"/>
|
||||
</argument>
|
||||
</service>
|
||||
<service id="alias_for_foo" alias="foo"/>
|
||||
<service id="alias_for_alias" alias="foo"/>
|
||||
</services>
|
||||
|
@ -118,3 +118,6 @@ services:
|
||||
arguments: [!closure_proxy ['@closure_proxy', getBaz]]
|
||||
alias_for_foo: '@foo'
|
||||
alias_for_alias: '@foo'
|
||||
service_locator:
|
||||
class: Bar
|
||||
arguments: [!service_locator { bar: '@bar', invalid: '@?invalid', container: '@service_container' }]
|
||||
|
Reference in New Issue
Block a user