public function initServers()
{
foreach ((array) $this->serverConfig as $name => $config) {
try {
if (!is_array($config)) {
throw new \RuntimeException();
}
$da = new Collection($config);
if ($da->has('local')) {
$builder = \Deployer\localServer($name);
} else {
$builder = $da->has('port') ? $this->serverBuilders[] = \Deployer\server($name, $da['host'], $da['port']) : ($this->serverBuilders[] = \Deployer\server($name, $da['host']));
}
unset($da['local']);
unset($da['host']);
unset($da['port']);
$this->executeBuilderMethods($da, $builder);
} catch (\RuntimeException $e) {
throw new \RuntimeException("Error processing servers: " . $name);
}
}
return $this;
}