for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Configuration\Connection;
use Doctrine\DBAL\Connection;
use Doctrine\Persistence\ConnectionRegistry;
use RuntimeException;
final class ConnectionRegistryConnection implements ConnectionLoader
{
/** @var ConnectionRegistry */
private $registry;
/** @var string|null */
private $connectionName;
public function __construct(ConnectionRegistry $registry)
$this->registry = $registry;
}
public function setConnectionName(?string $name) : void
$this->connectionName = $name;
public function getConnection() : Connection
$connection = $this->registry->getConnection($this->connectionName);
if (! $connection instanceof Connection) {
throw new RuntimeException('The returned connection must be @todo');
return $connection;