예제 #1
0
 private function processInstance($compiler)
 {
     if (is_object($compiler)) {
         return $compiler;
     } elseif (class_exists($compiler)) {
         return $this->container->getInstance($compiler);
     }
     throw Exception::neitherObjectOrClass($compiler);
 }
예제 #2
0
 private function getBinder()
 {
     $class = $this->context->hasCache() ? CachedBinder::class : Binder::class;
     return $this->container->getInstance($class);
 }
예제 #3
0
 /**
  * @test
  * @expectedException InvalidArgumentException
  */
 public function getInstance_failComplexDependencyLoop()
 {
     $this->target->getInstance(DummyLoopComplex::class);
 }