feature #23862 [SecurityBundle] resolve class name parameter inside AddSecurityVotersPass (pjarmalavicius)

This PR was squashed before being merged into the 3.4 branch (closes #23862).

Discussion
----------

[SecurityBundle] resolve class name parameter inside AddSecurityVotersPass

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23733
| License       | MIT

Commits
-------

a86bf52 [SecurityBundle] resolve class name parameter inside AddSecurityVotersPass
This commit is contained in:
Robin Chalas 2017-08-21 16:57:05 +02:00
commit a675d80333

View File

@ -42,7 +42,8 @@ class AddSecurityVotersPass implements CompilerPassInterface
}
foreach ($voters as $voter) {
$class = $container->getDefinition((string) $voter)->getClass();
$definition = $container->getDefinition((string) $voter);
$class = $container->getParameterBag()->resolveValue($definition->getClass());
if (!is_a($class, VoterInterface::class, true)) {
@trigger_error(sprintf('Using a security.voter tag on a class without implementing the %1$s is deprecated as of 3.4 and will be removed in 4.0. Implement the %1$s instead.', VoterInterface::class), E_USER_DEPRECATED);