Пример #1
0
 public function bind(Type $type)
 {
     if (!$type->isInstantiable()) {
         throw new ConfigurationException("Type {$type->name} is not instantiable");
     }
     $dependencies = [];
     $ctor = $type->getConstructor();
     foreach ($ctor ? $ctor->getParameters() : [] as $parameter) {
         $dependencies[] = $this->bindParameter($parameter);
     }
     $this->bindings->put(new InlineBinding($type, $dependencies));
 }
Пример #2
0
 public function matches(Type $type)
 {
     return $type->isInstantiable();
 }