private function addComponentFactories(array $factories)
{
$builder = $this->getContainerBuilder();
foreach ($factories as $component => $factory) {
if (strpos($factory, '::') === FALSE) {
$factory .= '::' . self::DEFAULT_FACTORY_METHOD;
}
if ($builder->hasDefinition($name = $this->prefix('registry.' . $component))) {
$definition = $builder->getDefinition($name);
} else {
$definition = $builder->addDefinition($name)->addTag(self::TAG_COMPONENT_REGISTRY, $component)->setAutowired(FALSE);
}
list($class, $method) = explode('::', $factory);
if (!Method::from($class, $method)->isStatic()) {
$factory = '@' . $factory;
}
$definition->setFactory($factory);
}
}