discovery = new StaticDiscovery(); $this->factory = new DefaultFactory($this->discovery, $interface); // Add the static definitions. foreach ($definitions as $key => $definition) { $this->discovery->setDefinition($key, $definition); } $this->moduleHandler = $module_handler; if ($alter_hook) { $this->alterInfo($alter_hook); } } }