コード例 #1
0
ファイル: Binder.php プロジェクト: enzyme/laravel-binder
 /**
  * Registers the given dependencies with the parent class.
  *
  * @param string $parent_fqn   The full namespaced class path.
  * @param array  $dependencies The collection of dependencies.
  */
 protected function registerDependencies($parent_fqn, array $dependencies)
 {
     foreach ($dependencies as $dependency) {
         $dependency_tree = $this->bindings[$dependency];
         $this->container->when($parent_fqn)->needs($this->getFqn($dependency_tree['interface']))->give($this->getFqn($dependency_tree['concrete']));
     }
 }
コード例 #2
0
 /**
  * @param string $class
  * @param string $compiledClass
  */
 protected function resolveContextualBindings($class, $compiledClass)
 {
     foreach ($this->app->contextual[$class] as $abstract => $concrete) {
         $this->app->when($compiledClass)->needs($abstract)->give($concrete);
     }
 }