diff --git a/mailpoet/lib/Config/DatabaseInitializer.php b/mailpoet/lib/Config/DatabaseInitializer.php index 67dabf8929..760d2306b5 100644 --- a/mailpoet/lib/Config/DatabaseInitializer.php +++ b/mailpoet/lib/Config/DatabaseInitializer.php @@ -1,24 +1,22 @@ -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()); } } diff --git a/mailpoet/prefixer/composer.json b/mailpoet/prefixer/composer.json index 8585d96402..dfd67d1508 100644 --- a/mailpoet/prefixer/composer.json +++ b/mailpoet/prefixer/composer.json @@ -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", diff --git a/mailpoet/prefixer/composer.lock b/mailpoet/prefixer/composer.lock index 2ecc5d2a3d..0d61477cf2 100644 --- a/mailpoet/prefixer/composer.lock +++ b/mailpoet/prefixer/composer.lock @@ -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", diff --git a/mailpoet/prefixer/fix-symfony-di.php b/mailpoet/prefixer/fix-symfony-di.php index 05ca692ee9..3d0d9ef637 100644 --- a/mailpoet/prefixer/fix-symfony-di.php +++ b/mailpoet/prefixer/fix-symfony-di.php @@ -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'); diff --git a/mailpoet/tasks/phpstan/phpstan-7-baseline.neon b/mailpoet/tasks/phpstan/phpstan-7-baseline.neon index 0835a3c250..7759ca4581 100644 --- a/mailpoet/tasks/phpstan/phpstan-7-baseline.neon +++ b/mailpoet/tasks/phpstan/phpstan-7-baseline.neon @@ -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 diff --git a/mailpoet/tasks/phpstan/phpstan-8-baseline.neon b/mailpoet/tasks/phpstan/phpstan-8-baseline.neon index ddbd5cd4f1..0269d5e915 100644 --- a/mailpoet/tasks/phpstan/phpstan-8-baseline.neon +++ b/mailpoet/tasks/phpstan/phpstan-8-baseline.neon @@ -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 - diff --git a/mailpoet/tasks/phpstan/phpstan-8.1-baseline.neon b/mailpoet/tasks/phpstan/phpstan-8.1-baseline.neon index 7fb4fd091a..0238759691 100644 --- a/mailpoet/tasks/phpstan/phpstan-8.1-baseline.neon +++ b/mailpoet/tasks/phpstan/phpstan-8.1-baseline.neon @@ -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 -