Revert "[DependencyInjection] Resolve parameters in tag arguments"
This reverts commit 3dba1fe7bf
.
This commit is contained in:
parent
2318170181
commit
9731451b5a
@ -6,7 +6,6 @@ CHANGELOG
|
|||||||
|
|
||||||
* added `param()` and `abstract_arg()` in the PHP-DSL
|
* added `param()` and `abstract_arg()` in the PHP-DSL
|
||||||
* deprecated `Definition::setPrivate()` and `Alias::setPrivate()`, use `setPublic()` instead
|
* deprecated `Definition::setPrivate()` and `Alias::setPrivate()`, use `setPublic()` instead
|
||||||
* added support for parameters in service tag arguments
|
|
||||||
|
|
||||||
5.1.0
|
5.1.0
|
||||||
-----
|
-----
|
||||||
|
@ -1250,7 +1250,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||||||
if ($throwOnAbstract && $definition->isAbstract()) {
|
if ($throwOnAbstract && $definition->isAbstract()) {
|
||||||
throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must not be abstract.', $id, $name));
|
throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must not be abstract.', $id, $name));
|
||||||
}
|
}
|
||||||
$tags[$id] = $this->parameterBag->resolveValue($definition->getTag($name));
|
$tags[$id] = $definition->getTag($name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -911,22 +911,6 @@ class ContainerBuilderTest extends TestCase
|
|||||||
$this->assertEquals([], $builder->findTaggedServiceIds('foobar'), '->findTaggedServiceIds() returns an empty array if there is annotated services');
|
$this->assertEquals([], $builder->findTaggedServiceIds('foobar'), '->findTaggedServiceIds() returns an empty array if there is annotated services');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testResolveTagAttributtes()
|
|
||||||
{
|
|
||||||
$builder = new ContainerBuilder();
|
|
||||||
$builder->getParameterBag()->add(['foo_argument' => 'foo']);
|
|
||||||
|
|
||||||
$builder
|
|
||||||
->register('foo', 'Bar\FooClass')
|
|
||||||
->addTag('foo', ['foo' => '%foo_argument%'])
|
|
||||||
;
|
|
||||||
$this->assertEquals($builder->findTaggedServiceIds('foo'), [
|
|
||||||
'foo' => [
|
|
||||||
['foo' => 'foo'],
|
|
||||||
],
|
|
||||||
], '->findTaggedServiceIds() replaces parameters in tag attributes');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testFindUnusedTags()
|
public function testFindUnusedTags()
|
||||||
{
|
{
|
||||||
$builder = new ContainerBuilder();
|
$builder = new ContainerBuilder();
|
||||||
|
Reference in New Issue
Block a user