title: Symfony AutoWire multiple services same class
body: <p>i am in the process of upgrading a large application to 4.2</p>
  
  <p>and the <code>$this-&gt;get(".....")</code>  from inside the controller is deprecated and one should use AutoWire instead.</p>
  
  <p>i am running into the problem that i have 2 services, which are in fact from the same class (just diffrent constructor args).</p>
  
  <p>services.yml</p>
  
  <pre><code>services:
    service.a:
      class: Namespace\MyClass
      arguments: [ "argument1" ]
  
    service.b:
      class: Namespace\MyClass
      arguments: [ "argument2" ]
  </code></pre>
  
  <p>controller:</p>
  
  <pre><code>public function demoAction() {
    $serviceA = $this-&gt;get("service.a");
    $serviceB = $this-&gt;get("service.b");
  }
  </code></pre>
  
  <p>and the problematic result:</p>
  
  <pre><code>public function demoAction(MyClass $serviceA, MyClass $serviceB) {
  }
  </code></pre>
  
  <p>we can use alias to service definitions like:</p>
  
  <pre><code>MyClass: '@service.a'
  </code></pre>
  
  <p>but i cannot use a virtual/fake class like (without an existing one):</p>
  
  <pre><code>MyPseudClass: '@service.b'
  </code></pre>
  
  <p>how do you handle cases like this in autowire mode?</p>
  
  <p>i could create "pseudo" classes, that extend from the base, just to get different classnames, but that feels weird.</p>