title: How does dependency Injection know what variables to pass?
body: <p>I am struggling with the idea of a dependency injection container.</p>
  
  <p>Not sure how to explain but I will try with a few examples:</p>
  
  <pre><code>class foo
  {
      public function __construct(\Somenamespace\Bar $bar, $x)
      {
  
      }
  }
  </code></pre>
  
  <p>How would the DIC know what 'x' would be?</p>
  
  <p>And if we go further down the road and look at the bar class. The DIC can with no problem with reflection create Bar.</p>
  
  <pre><code>namespace \Somenamespace;
  class bar
  {
      public function __construct(\SomethingElse\Tap $tap, $y)
      {
  
      }   
  }
  </code></pre>
  
  <p>The bar wants taps and the tap could also be found by the DIC but how does it know about 'y'?</p>
  
  <p>And if we create the tap.</p>
  
  <pre><code>namespace\SomethingElse;
  class tap
  {
      public function __construct($amountOfTaps)
      {
  
      }
  }
  </code></pre>
  
  <p>How would the DIC know about the amount of taps or whatever variable?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Same question does for if the hinted type is an interface or an abstract class. How does a DIC figure out what he needs to create?</p>