Revert "[DependencyInjection] Resolve parameters in tag arguments"

This reverts commit 3dba1fe7bf.
This commit is contained in:
Remon van de Kamp 2020-08-10 19:30:39 +02:00
parent 2318170181
commit 9731451b5a
No known key found for this signature in database
GPG Key ID: DB4A5E50852390A3
3 changed files with 1 additions and 18 deletions

View File

@ -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
----- -----

View File

@ -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);
} }
} }

View File

@ -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();