<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>yes</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.4.x-dev (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/symfony/symfony/commit/8c4a1e75bee9e8110937fb6ec1ccf94aa1556a52/hovercard" href="https://github.com/symfony/symfony/commit/8c4a1e75bee9e8110937fb6ec1ccf94aa1556a52"><tt>8c4a1e7</tt></a>)</td>
</tr>
</tbody>
</table>
<p dir="auto">Error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PHP Fatal error:  Uncaught Symfony\Component\DependencyInjection\Exception\LogicException: %scheb_two_factor.security_voter.class% should implement the Symfony\Component\Security\Core\Authorization\Voter\VoterInterface interface when used as voter. in vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php:54"><pre class="notranslate"><code class="notranslate">PHP Fatal error:  Uncaught Symfony\Component\DependencyInjection\Exception\LogicException: %scheb_two_factor.security_voter.class% should implement the Symfony\Component\Security\Core\Authorization\Voter\VoterInterface interface when used as voter. in vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php:54
</code></pre></div>
<p dir="auto">This service is defined in <a href="https://github.com/scheb/two-factor-bundle/blob/master/Resources/config/security.xml#L52">https://github.com/scheb/two-factor-bundle/blob/master/Resources/config/security.xml#L52</a>. Looks like class is not resolved in <a href="https://github.com/symfony/security-bundle/blob/master/DependencyInjection/Compiler/AddSecurityVotersPass.php#L45">https://github.com/symfony/security-bundle/blob/master/DependencyInjection/Compiler/AddSecurityVotersPass.php#L45</a>.<br>
It returns parameter instead.<br>
Error is going away when I hardcode FQCN instead of <code class="notranslate">%scheb_two_factor.security_voter.class%</code> parameter.</p>
<p dir="auto">I've read <a href="https://github.com/symfony/symfony/blob/master/UPGRADE-3.4.md#securitybundle">https://github.com/symfony/symfony/blob/master/UPGRADE-3.4.md#securitybundle</a> and this class does implement <code class="notranslate">VoterInterface</code>, the problem lies in fact that <code class="notranslate">AddSecurityVotersPass</code> is operating with <code class="notranslate">"%scheb_two_factor.security_voter.class%"</code> string instead with FQCN.</p>
<p dir="auto">/cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nicolas-grekas/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nicolas-grekas">@nicolas-grekas</a></p>
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.4</td>
</tr>
</tbody>
</table>
<p dir="auto">When voter service class is parameter, it is not yet resolved while checking if it implements VoterInterface.<br>
Maybe type of AddSecurityVotersPass should be "optimization"?</p>