private function getConnection(InputInterface $input)
{
if ($this->connection) {
return $this->connection;
}
$chainLoader = new ConnectionConfigurationChainLoader([new ArrayConnectionConfigurationLoader($input->getOption('db-configuration')), new ArrayConnectionConfigurationLoader('migrations-db.php'), new ConnectionHelperLoader($this->getHelperSet(), 'connection'), new ConnectionConfigurationLoader($this->configuration)]);
$connection = $chainLoader->chosen();
if ($connection) {
return $this->connection = $connection;
}
throw new \InvalidArgumentException('You have to specify a --db-configuration file or pass a Database Connection as a dependency to the Migrations.');
}