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)); }
public function matches(Type $type) { return $type->isInstantiable(); }