コード例 #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
 protected function setUp()
 {
     $container = new IocContainer();
     $this->binder = new BinderStub();
     $container->register(Binder::class, $this->binder);
     $this->cache = new CachedBinderStub();
     $container->register(CachedBinder::class, $this->cache);
     $this->context = new ContextMock();
     $this->compiler = new ProcessorListStub();
     $handler = new CompilerHandler($this->compiler, $container);
     $executor = new Executor($container, $this->context);
     $this->target = new FluentBuilder($executor, $this->context, $handler);
 }
コード例 #3
0
ファイル: Executor.php プロジェクト: phaldan/asset-builder
 private function getBinder()
 {
     $class = $this->context->hasCache() ? CachedBinder::class : Binder::class;
     return $this->container->getInstance($class);
 }
コード例 #4
0
 /**
  * @test
  * @expectedException InvalidArgumentException
  */
 public function getInstance_failComplexDependencyLoop()
 {
     $this->target->getInstance(DummyLoopComplex::class);
 }