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());
}
}

View File

@@ -11,7 +11,7 @@
"psr/cache": "^1.0",
"sabberworm/php-css-parser": "^8.1",
"swiftmailer/swiftmailer": "6.3.0",
"symfony/dependency-injection": "4.4.39",
"symfony/dependency-injection": "5.4.7",
"symfony/polyfill-ctype": "1.18.1",
"symfony/polyfill-iconv": "1.18.1",
"symfony/polyfill-intl-idn": "1.18.1",

View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "b63930384efc07b7da7ef21bf2f71c93",
"content-hash": "c6365c6d29f7561219eee58bd20870c1",
"packages": [
{
"name": "cerdic/css-tidy",
@@ -1670,28 +1670,31 @@
},
{
"name": "symfony/dependency-injection",
"version": "v4.4.39",
"version": "v5.4.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "5d0fbcdb9317864b2bd9e49d570d88ae512cadf3"
"reference": "35588b2afb08ea3a142d62fefdcad4cb09be06ed"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/5d0fbcdb9317864b2bd9e49d570d88ae512cadf3",
"reference": "5d0fbcdb9317864b2bd9e49d570d88ae512cadf3",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/35588b2afb08ea3a142d62fefdcad4cb09be06ed",
"reference": "35588b2afb08ea3a142d62fefdcad4cb09be06ed",
"shasum": ""
},
"require": {
"php": ">=7.1.3",
"psr/container": "^1.0",
"php": ">=7.2.5",
"psr/container": "^1.1.1",
"symfony/deprecation-contracts": "^2.1|^3",
"symfony/polyfill-php80": "^1.16",
"symfony/polyfill-php81": "^1.22",
"symfony/service-contracts": "^1.1.6|^2"
},
"conflict": {
"symfony/config": "<4.3|>=5.0",
"symfony/finder": "<3.4",
"symfony/proxy-manager-bridge": "<3.4",
"ext-psr": "<1.1|>=2",
"symfony/config": "<5.3",
"symfony/finder": "<4.4",
"symfony/proxy-manager-bridge": "<4.4",
"symfony/yaml": "<4.4.26"
},
"provide": {
@@ -1699,9 +1702,9 @@
"symfony/service-implementation": "1.0|2.0"
},
"require-dev": {
"symfony/config": "^4.3",
"symfony/expression-language": "^3.4|^4.0|^5.0",
"symfony/yaml": "^4.4.26|^5.0"
"symfony/config": "^5.3|^6.0",
"symfony/expression-language": "^4.4|^5.0|^6.0",
"symfony/yaml": "^4.4.26|^5.0|^6.0"
},
"suggest": {
"symfony/config": "",
@@ -1736,7 +1739,7 @@
"description": "Allows you to standardize and centralize the way objects are constructed in your application",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/dependency-injection/tree/v4.4.39"
"source": "https://github.com/symfony/dependency-injection/tree/v5.4.7"
},
"funding": [
{
@@ -1752,7 +1755,7 @@
"type": "tidelift"
}
],
"time": "2022-03-02T12:36:39+00:00"
"time": "2022-03-08T15:43:06+00:00"
},
{
"name": "symfony/deprecation-contracts",

View File

@@ -25,3 +25,11 @@ foreach ($replacements as $singleFile) {
$data = str_replace($singleFile['find'], $singleFile['replace'], $data);
file_put_contents($singleFile['file'], $data);
}
// removing attribute classes because contain features from PHP 8.0, and then the job qa:php-max-wporg fails
exec('rm ' . __DIR__ . '/../vendor-prefixed/symfony/dependency-injection/Attribute/AsTaggedItem.php');
exec('rm ' . __DIR__ . '/../vendor-prefixed/symfony/dependency-injection/Attribute/Autoconfigure.php');
exec('rm ' . __DIR__ . '/../vendor-prefixed/symfony/dependency-injection/Attribute/AutoconfigureTag.php');
exec('rm ' . __DIR__ . '/../vendor-prefixed/symfony/dependency-injection/Attribute/TaggedIterator.php');
exec('rm ' . __DIR__ . '/../vendor-prefixed/symfony/dependency-injection/Attribute/TaggedLocator.php');
exec('rm ' . __DIR__ . '/../vendor-prefixed/symfony/dependency-injection/Attribute/When.php');

View File

@@ -132,7 +132,7 @@ parameters:
path: ../../lib/Cache/TransientCache.php
-
message: "#^Cannot call method getWrappedConnection\\(\\) on mixed\\.$#"
message: "#^Parameter \\#1 \\$pdo of method MailPoet\\\\Config\\\\Database\\:\\:init\\(\\) expects PDO, MailPoetVendor\\\\Doctrine\\\\DBAL\\\\Driver\\\\Connection given\\.$#"
count: 1
path: ../../lib/Config/DatabaseInitializer.php

View File

@@ -132,7 +132,7 @@ parameters:
path: ../../lib/Cache/TransientCache.php
-
message: "#^Cannot call method getWrappedConnection\\(\\) on mixed\\.$#"
message: "#^Parameter \\#1 \\$pdo of method MailPoet\\\\Config\\\\Database\\:\\:init\\(\\) expects PDO, MailPoetVendor\\\\Doctrine\\\\DBAL\\\\Driver\\\\Connection given\\.$#"
count: 1
path: ../../lib/Config/DatabaseInitializer.php
@@ -1680,4 +1680,3 @@ parameters:
message: "#^Part \\$table \\(mixed\\) of encapsed string cannot be cast to string\\.$#"
count: 1
path: ../../tests/integration/_bootstrap.php

View File

@@ -141,7 +141,7 @@ parameters:
path: ../../lib/Cache/TransientCache.php
-
message: "#^Cannot call method getWrappedConnection\\(\\) on mixed\\.$#"
message: "#^Parameter \\#1 \\$pdo of method MailPoet\\\\Config\\\\Database\\:\\:init\\(\\) expects PDO, MailPoetVendor\\\\Doctrine\\\\DBAL\\\\Driver\\\\Connection given\\.$#"
count: 1
path: ../../lib/Config/DatabaseInitializer.php
@@ -1709,4 +1709,3 @@ parameters:
message: "#^Part \\$table \\(mixed\\) of encapsed string cannot be cast to string\\.$#"
count: 1
path: ../../tests/integration/_bootstrap.php