title: Unpack Symfony "tagged Services"
body: <p>I got a class which accepts multiple <code>Consumer</code> implementations as constructor arguments.</p>
  
  <p>I want to "fill in" all my Consumers via the Symfony DI-Container.
  I tried injection tagged services.</p>
  
  <pre><code>final class SynchronousMessageDispatcher implements MessageDispatcher
  {
      /**
       * @var Consumer[]
       */
      private $consumers;
  
      public function __construct(Consumer ...$consumers)
      {
          $this-&gt;consumers = $consumers;
      }
  }
  </code></pre>
  
  <p>So I tried to Tag the services in the <code>services.yml</code> like that:</p>
  
  <pre><code>services:
      _instanceof:
          EventSauce\EventSourcing\Consumer:
              tags: ['eventsauce.consumer']
  </code></pre>
  
  <p>And then inject it like this:</p>
  
  <pre><code>eventsauce.message_dispatcher:
      class: EventSauce\EventSourcing\SynchronousMessageDispatcher
      arguments: [!tagged eventsauce.consumer]
  </code></pre>
  
  <p>Now I'm getting the following error:</p>
  
  <blockquote>
    <p>Argument 1 passed to EventSauce\EventSourcing\SynchronousMessageDispatcher::__construct() must implement interface EventSauce\EventSourcing\Consumer, instance of Symfony\Component\DependencyInjection\Argument\RewindableGenerator given</p>
  </blockquote>
  
  <p>I fully understand why. Is there a way to <strong>unpack services</strong></p>
  
  <p>In other words: Is it possible to modify <code>[!tagged eventsauce.consumer]</code> somehow. Or is the <code>...$consumers</code> syntax incompatible with the Tagged service Injection in Symfony.</p>
  
  <p>Don't get me wrong. I know that I can easily implement <code>MessageDispatcher</code> myself. Just wanted to know ;-)</p>