Skip to content

Revert "[DependencyInjection] Resolve parameters in tag arguments" #37793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Symfony/Component/DependencyInjection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ CHANGELOG

* added `param()` and `abstract_arg()` in the PHP-DSL
* deprecated `Definition::setPrivate()` and `Alias::setPrivate()`, use `setPublic()` instead
* added support for parameters in service tag arguments

5.1.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ public function findTaggedServiceIds(string $name, bool $throwOnAbstract = false
if ($throwOnAbstract && $definition->isAbstract()) {
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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,22 +911,6 @@ public function testfindTaggedServiceIds()
$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()
{
$builder = new ContainerBuilder();
Expand Down