<p dir="auto"><strong>Symfony version(s) affected</strong>: 3.4.13</p>
<p dir="auto"><strong>Description</strong><br>
Binding controller service argument used to work in Symfony 3.4.12, but not in 3.4.13 anymore.</p>
<p dir="auto"><strong>How to reproduce</strong><br>
service.yml :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="services:
    _defaults:
        autowire: true
        autoconfigure: true
        public: true
        bind:
            $em: '@doctrine.orm.my_entity_manager'

    My\FrontofficeBundle\Controller\:
        resource: '../../Controller'
        tags: ['controller.service_arguments']"><pre class="notranslate"><code class="notranslate">services:
    _defaults:
        autowire: true
        autoconfigure: true
        public: true
        bind:
            $em: '@doctrine.orm.my_entity_manager'

    My\FrontofficeBundle\Controller\:
        resource: '../../Controller'
        tags: ['controller.service_arguments']
</code></pre></div>
<p dir="auto">The controller action is defined as :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public function indexAction(Request $request, EntityManagerInterface $em)
{
..."><pre class="notranslate"><code class="notranslate">public function indexAction(Request $request, EntityManagerInterface $em)
{
...
</code></pre></div>
<p dir="auto">I have several entity managers defined in config.yml, and <code class="notranslate">my_entity_manager</code> is not the default one.<br>
In Symfony 3.4.13, the controller action gets the default entity manager. I would expect it to be passed <code class="notranslate">my_entity_manager</code>, like in Symfony 3.4.12.</p>
<p dir="auto"><strong>Possible Solution</strong></p>
<p dir="auto">A solution is to inject the entity manager via a controller constructor :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="	public function __construct(EntityManagerInterface $em)
	{
		$this-&gt;em = $em;
	}"><pre class="notranslate"><code class="notranslate">	public function __construct(EntityManagerInterface $em)
	{
		$this-&gt;em = $em;
	}
</code></pre></div>
<p dir="auto">Then we get the correct entity manager.<br>
But is this behaviour expected ? And is it expected that the behaviour changed between minor Symfony versions ?</p>
<p dir="auto"><strong>Symfony version(s) affected</strong>: 4.1.2</p>
<p dir="auto"><strong>How to reproduce</strong><br>
Bind a value to a controller will cause the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" In ResolveBindingsPass.php line 48:

 Unused binding &quot;$advertiserFetcher&quot; in service 
 &quot;App\Controller\Admin\CampaignAdminController&quot;."><pre class="notranslate"><code class="notranslate"> In ResolveBindingsPass.php line 48:

 Unused binding "$advertiserFetcher" in service 
 "App\Controller\Admin\CampaignAdminController".
</code></pre></div>
<p dir="auto">services.yml:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="App\Controller\Admin\CampaignAdminController: 
       bind:
           $advertiserFetcher: '@app.advertiser_fetcher'"><pre class="notranslate"><code class="notranslate">App\Controller\Admin\CampaignAdminController: 
       bind:
           $advertiserFetcher: '@app.advertiser_fetcher'
</code></pre></div>
<p dir="auto">CampaignAdminController:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" /**
 * @Route(&quot;/&quot;, name=&quot;campaign_admin_index&quot;)
 * @param AdvertiserFetcherInterface $advertiserFetcher
 * @return Response
 */
public function indexAction(AdvertiserFetcherInterface $advertiserFetcher)
{
        $advertisers = $advertiserFetcher-&gt;fetchAdvertisers();
        ...
}"><pre class="notranslate"><code class="notranslate"> /**
 * @Route("/", name="campaign_admin_index")
 * @param AdvertiserFetcherInterface $advertiserFetcher
 * @return Response
 */
public function indexAction(AdvertiserFetcherInterface $advertiserFetcher)
{
        $advertisers = $advertiserFetcher-&gt;fetchAdvertisers();
        ...
}
</code></pre></div>
<p dir="auto"><strong>Possible Solution</strong><br>
Make <a href="https://github.com/symfony/symfony/issues/28041" data-hovercard-type="issue" data-hovercard-url="/symfony/symfony/issues/28041/hovercard">bugfix 28041</a> available on symfony 4.1.2 too.</p>