Update symfony/dependency-injection package to v5

[MAILPOET-4227]
This commit is contained in:
Jan Lysý
2022-04-22 14:12:54 +02:00
committed by Veljko V
parent 4ed3c44d6b
commit c08bde077b
7 changed files with 36 additions and 29 deletions

View File

@@ -1,24 +1,22 @@
<?php
<?php declare(strict_types = 1);
namespace MailPoet\Config;
use MailPoetVendor\Doctrine\DBAL\Connection;
use MailPoetVendor\Psr\Container\ContainerInterface;
class DatabaseInitializer {
private $diContainer;
/** @var Connection */
private $connection;
public function __construct(
ContainerInterface $diContainer
Connection $connection
) {
$this->diContainer = $diContainer;
$this->connection = $connection;
}
public function initializeConnection() {
$connection = $this->diContainer->get(Connection::class);
// pass the same PDO connection to legacy Database object
$database = new Database();
$database->init($connection->getWrappedConnection());
$database->init($this->connection->getWrappedConnection());
}
}