diff --git a/mailpoet/lib/Config/DatabaseInitializer.php b/mailpoet/lib/Config/DatabaseInitializer.php index 760d2306b5..7e347729f7 100644 --- a/mailpoet/lib/Config/DatabaseInitializer.php +++ b/mailpoet/lib/Config/DatabaseInitializer.php @@ -17,6 +17,6 @@ class DatabaseInitializer { public function initializeConnection() { // pass the same PDO connection to legacy Database object $database = new Database(); - $database->init($this->connection->getWrappedConnection()); + $database->init($this->connection->getNativeConnection()); } } diff --git a/mailpoet/lib/Cron/Workers/StatsNotifications/NewsletterLinkRepository.php b/mailpoet/lib/Cron/Workers/StatsNotifications/NewsletterLinkRepository.php index 61297ba0bd..12f93fe400 100644 --- a/mailpoet/lib/Cron/Workers/StatsNotifications/NewsletterLinkRepository.php +++ b/mailpoet/lib/Cron/Workers/StatsNotifications/NewsletterLinkRepository.php @@ -5,7 +5,7 @@ namespace MailPoet\Cron\Workers\StatsNotifications; use MailPoet\Doctrine\Repository; use MailPoet\Entities\NewsletterLinkEntity; use MailPoet\Entities\StatisticsClickEntity; -use MailPoetVendor\Doctrine\DBAL\Driver\Statement; +use MailPoetVendor\Doctrine\DBAL\Result; /** * @extends Repository @@ -31,7 +31,7 @@ class NewsletterLinkRepository extends Repository { ->orderBy('counter', 'desc') ->setMaxResults(1) ->execute(); - if (!$topIdQuery instanceof Statement) { + if (!$topIdQuery instanceof Result) { return null; } $topId = $topIdQuery->fetch(); diff --git a/mailpoet/lib/Doctrine/ConnectionFactory.php b/mailpoet/lib/Doctrine/ConnectionFactory.php index eda67c4c70..e800bcf57c 100644 --- a/mailpoet/lib/Doctrine/ConnectionFactory.php +++ b/mailpoet/lib/Doctrine/ConnectionFactory.php @@ -10,13 +10,13 @@ use MailPoet\Doctrine\Types\JsonType; use MailPoet\Doctrine\Types\SerializedArrayType; use MailPoetVendor\Doctrine\DBAL\Driver\PDO\MySQL\Driver; use MailPoetVendor\Doctrine\DBAL\DriverManager; -use MailPoetVendor\Doctrine\DBAL\Platforms\MySqlPlatform; +use MailPoetVendor\Doctrine\DBAL\Platforms\MySQLPlatform; use MailPoetVendor\Doctrine\DBAL\Types\Type; use PDO; class ConnectionFactory { const DRIVER = 'pdo_mysql'; - const PLATFORM_CLASS = MySqlPlatform::class; + const PLATFORM_CLASS = MySQLPlatform::class; private $minWaitTimeout = 60; diff --git a/mailpoet/lib/Doctrine/SerializableConnection.php b/mailpoet/lib/Doctrine/SerializableConnection.php index 7548320818..f822ae6053 100644 --- a/mailpoet/lib/Doctrine/SerializableConnection.php +++ b/mailpoet/lib/Doctrine/SerializableConnection.php @@ -47,16 +47,4 @@ class SerializableConnection extends Connection { throw $e; } } - - public function handleExceptionDuringQuery(Throwable $e, string $sql, array $params = [], array $types = []): void { - try { - parent::handleExceptionDuringQuery($e, $sql, $params, $types); - } catch (Throwable $err) { - $mySqlGoneAwayMessage = Helpers::mySqlGoneAwayExceptionHandler($err); - if ($mySqlGoneAwayMessage) { - throw new \Exception($mySqlGoneAwayMessage, (int)$err->getCode(), $err); - } - throw $err; - } - } } diff --git a/mailpoet/lib/Logging/LogRepository.php b/mailpoet/lib/Logging/LogRepository.php index e1fc2c1537..9031918487 100644 --- a/mailpoet/lib/Logging/LogRepository.php +++ b/mailpoet/lib/Logging/LogRepository.php @@ -9,7 +9,6 @@ use MailPoet\InvalidStateException; use MailPoet\Util\Helpers; use MailPoet\WP\Functions; use MailPoetVendor\Carbon\Carbon; -use MailPoetVendor\Doctrine\DBAL\Driver\PDO\Connection; use MailPoetVendor\Doctrine\ORM\EntityManager; /** @@ -116,8 +115,8 @@ class LogRepository extends Repository { 'limit' => $limit, ], [ - 'date' => Connection::PARAM_STR, - 'limit' => Connection::PARAM_INT, + 'date' => \PDO::PARAM_STR, + 'limit' => \PDO::PARAM_INT, ] ); } diff --git a/mailpoet/lib/Newsletter/NewslettersRepository.php b/mailpoet/lib/Newsletter/NewslettersRepository.php index 55a6b5e9db..45cfecfb7e 100644 --- a/mailpoet/lib/Newsletter/NewslettersRepository.php +++ b/mailpoet/lib/Newsletter/NewslettersRepository.php @@ -47,7 +47,7 @@ class NewslettersRepository extends Repository { ->select('n') ->from(NewsletterEntity::class, 'n') ->where('n.status = :status') - ->setParameter(':status', NewsletterEntity::STATUS_ACTIVE) + ->setParameter('status', NewsletterEntity::STATUS_ACTIVE) ->andWhere('n.deletedAt is null') ->andWhere('n.type IN (:types)') ->setParameter('types', $types) @@ -105,7 +105,7 @@ class NewslettersRepository extends Repository { ->select('n') ->from(NewsletterEntity::class, 'n') ->where('n.status = :status') - ->setParameter(':status', NewsletterEntity::STATUS_ACTIVE) + ->setParameter('status', NewsletterEntity::STATUS_ACTIVE) ->andWhere('n.deletedAt IS NULL') ->andWhere('n.type = :type') ->setParameter('type', $type); @@ -130,7 +130,7 @@ class NewslettersRepository extends Repository { ->select('n') ->from(NewsletterEntity::class, 'n') ->where('n.status = :status') - ->setParameter(':status', NewsletterEntity::STATUS_DRAFT) + ->setParameter('status', NewsletterEntity::STATUS_DRAFT) ->andWhere('n.deletedAt is null') ->andWhere('n.type IN (:types)') ->setParameter('types', $types) diff --git a/mailpoet/lib/Newsletter/Scheduler/ReEngagementScheduler.php b/mailpoet/lib/Newsletter/Scheduler/ReEngagementScheduler.php index b0fa209354..7a6d8d8a55 100644 --- a/mailpoet/lib/Newsletter/Scheduler/ReEngagementScheduler.php +++ b/mailpoet/lib/Newsletter/Scheduler/ReEngagementScheduler.php @@ -169,7 +169,7 @@ class ReEngagementScheduler { $statement->bindParam('newsletterId', $newsletterId, ParameterType::INTEGER); $statement->bindParam('segmentId', $segmentId, ParameterType::INTEGER); - $statement->executeQuery(); - return (int)$statement->rowCount(); + $result = $statement->executeQuery(); + return $result->rowCount(); } } diff --git a/mailpoet/lib/Segments/DynamicSegments/Filters/MailPoetCustomFields.php b/mailpoet/lib/Segments/DynamicSegments/Filters/MailPoetCustomFields.php index a4f1829475..8088039a4e 100644 --- a/mailpoet/lib/Segments/DynamicSegments/Filters/MailPoetCustomFields.php +++ b/mailpoet/lib/Segments/DynamicSegments/Filters/MailPoetCustomFields.php @@ -36,7 +36,7 @@ class MailPoetCustomFields implements Filter { $customFieldType = $filterData->getParam('custom_field_type'); $customFieldId = $filterData->getParam('custom_field_id'); $parameterSuffix = (string)($filter->getId() ?? Security::generateRandomString()); - $customFieldIdParam = ':customFieldId' . $parameterSuffix; + $customFieldIdParam = 'customFieldId' . $parameterSuffix; $subscribersTable = $this->entityManager->getClassMetadata(SubscriberEntity::class)->getTableName(); $subscribersCustomFieldTable = $this->entityManager->getClassMetadata(SubscriberCustomFieldEntity::class)->getTableName(); @@ -45,11 +45,11 @@ class MailPoetCustomFields implements Filter { $subscribersTable, $subscribersCustomFieldTable, 'subscribers_custom_field', - "$subscribersTable.id = subscribers_custom_field.subscriber_id AND subscribers_custom_field.custom_field_id = $customFieldIdParam" + "$subscribersTable.id = subscribers_custom_field.subscriber_id AND subscribers_custom_field.custom_field_id = :$customFieldIdParam" ); $queryBuilder->setParameter($customFieldIdParam, $customFieldId); - $valueParam = ':value' . $parameterSuffix; + $valueParam = 'value' . $parameterSuffix; if ( ($customFieldType === CustomFieldEntity::TYPE_TEXT) || ($customFieldType === CustomFieldEntity::TYPE_TEXTAREA) @@ -88,30 +88,30 @@ class MailPoetCustomFields implements Filter { } private function applyForDateMonth(QueryBuilder $queryBuilder, string $valueParam): QueryBuilder { - $queryBuilder->andWhere("month(subscribers_custom_field.value) = month($valueParam)"); + $queryBuilder->andWhere("month(subscribers_custom_field.value) = month(:$valueParam)"); return $queryBuilder; } private function applyForDateYear(QueryBuilder $queryBuilder, ?string $operator, string $valueParam): QueryBuilder { if ($operator === 'before') { - $queryBuilder->andWhere("year(subscribers_custom_field.value) < year($valueParam)"); + $queryBuilder->andWhere("year(subscribers_custom_field.value) < year(:$valueParam)"); } elseif ($operator === 'after') { - $queryBuilder->andWhere("year(subscribers_custom_field.value) > year($valueParam)"); + $queryBuilder->andWhere("year(subscribers_custom_field.value) > year(:$valueParam)"); } else { - $queryBuilder->andWhere("year(subscribers_custom_field.value) = year($valueParam)"); + $queryBuilder->andWhere("year(subscribers_custom_field.value) = year(:$valueParam)"); } return $queryBuilder; } private function applyForDateEqual(QueryBuilder $queryBuilder, ?string $operator, string $valueParam): QueryBuilder { if ($operator === 'before') { - $queryBuilder->andWhere("subscribers_custom_field.value < $valueParam"); + $queryBuilder->andWhere("subscribers_custom_field.value < :$valueParam"); } elseif ($operator === 'after') { - $queryBuilder->andWhere("subscribers_custom_field.value > $valueParam"); + $queryBuilder->andWhere("subscribers_custom_field.value > :$valueParam"); } else { // we always save full date in the database: 2018-03-01 00:00:00 // so this works even for year_month where we save the first day of the month - $queryBuilder->andWhere("subscribers_custom_field.value = $valueParam"); + $queryBuilder->andWhere("subscribers_custom_field.value = :$valueParam"); } return $queryBuilder; } @@ -148,27 +148,27 @@ class MailPoetCustomFields implements Filter { /** @var string $value - for PhpStan */ if ($operator === 'equals') { - $queryBuilder->andWhere("subscribers_custom_field.value = $valueParam"); + $queryBuilder->andWhere("subscribers_custom_field.value = :$valueParam"); $queryBuilder->setParameter($valueParam, $value); } elseif ($operator === 'not_equals') { - $queryBuilder->andWhere("subscribers_custom_field.value != $valueParam"); + $queryBuilder->andWhere("subscribers_custom_field.value != :$valueParam"); $queryBuilder->orWhere('subscribers_custom_field.value IS NULL'); $queryBuilder->setParameter($valueParam, $value); } elseif ($operator === 'more_than') { - $queryBuilder->andWhere("subscribers_custom_field.value > $valueParam"); + $queryBuilder->andWhere("subscribers_custom_field.value > :$valueParam"); $queryBuilder->setParameter($valueParam, $value); } elseif ($operator === 'less_than') { - $queryBuilder->andWhere("subscribers_custom_field.value < $valueParam"); + $queryBuilder->andWhere("subscribers_custom_field.value < :$valueParam"); $queryBuilder->setParameter($valueParam, $value); } elseif ($operator === DynamicSegmentFilterData::IS_BLANK) { $queryBuilder->andWhere('subscribers_custom_field.value IS NULL OR subscribers_custom_field.value = ""'); } elseif ($operator === DynamicSegmentFilterData::IS_NOT_BLANK) { $queryBuilder->andWhere('subscribers_custom_field.value IS NOT NULL AND subscribers_custom_field.value != ""'); } elseif ($operator === 'not_contains') { - $queryBuilder->andWhere("subscribers_custom_field.value NOT LIKE $valueParam"); + $queryBuilder->andWhere("subscribers_custom_field.value NOT LIKE :$valueParam"); $queryBuilder->setParameter($valueParam, '%' . Helpers::escapeSearch($value) . '%'); } else { - $queryBuilder->andWhere("subscribers_custom_field.value LIKE $valueParam"); + $queryBuilder->andWhere("subscribers_custom_field.value LIKE :$valueParam"); $queryBuilder->setParameter($valueParam, '%' . Helpers::escapeSearch($value) . '%'); } diff --git a/mailpoet/lib/Segments/DynamicSegments/Filters/UserRole.php b/mailpoet/lib/Segments/DynamicSegments/Filters/UserRole.php index 724a47e8e6..f6601115d8 100644 --- a/mailpoet/lib/Segments/DynamicSegments/Filters/UserRole.php +++ b/mailpoet/lib/Segments/DynamicSegments/Filters/UserRole.php @@ -46,7 +46,7 @@ class UserRole implements Filter { ->join('wpusers', $wpdb->usermeta, 'wpusermeta', 'wpusers.id = wpusermeta.user_id') ->andWhere("wpusermeta.meta_key = '{$wpdb->prefix}capabilities' AND (" . $condition . ')'); foreach ($role as $key => $userRole) { - $qb->setParameter(':role' . $key . $parameterSuffix, '%"' . $userRole . '"%'); + $qb->setParameter('role' . $key . $parameterSuffix, '%"' . $userRole . '"%'); } return $qb; } diff --git a/mailpoet/lib/Segments/DynamicSegments/Filters/WooCommerceCountry.php b/mailpoet/lib/Segments/DynamicSegments/Filters/WooCommerceCountry.php index 5097826990..4e6a1aba96 100644 --- a/mailpoet/lib/Segments/DynamicSegments/Filters/WooCommerceCountry.php +++ b/mailpoet/lib/Segments/DynamicSegments/Filters/WooCommerceCountry.php @@ -56,7 +56,7 @@ class WooCommerceCountry implements Filter { )->where($condition); foreach ($countryCode as $key => $userCountryCode) { - $qb->setParameter(':countryCode' . $key . $countryFilterParam, '%' . $userCountryCode . '%'); + $qb->setParameter('countryCode' . $key . $countryFilterParam, '%' . $userCountryCode . '%'); } return $qb; diff --git a/mailpoet/lib/Segments/SegmentSubscribersRepository.php b/mailpoet/lib/Segments/SegmentSubscribersRepository.php index 03d733e6c5..4f9517f9c9 100644 --- a/mailpoet/lib/Segments/SegmentSubscribersRepository.php +++ b/mailpoet/lib/Segments/SegmentSubscribersRepository.php @@ -12,8 +12,8 @@ use MailPoet\NotFoundException; use MailPoet\Segments\DynamicSegments\Exceptions\InvalidFilterException; use MailPoet\Segments\DynamicSegments\FilterHandler; use MailPoetVendor\Doctrine\DBAL\Connection; -use MailPoetVendor\Doctrine\DBAL\Driver\Statement; use MailPoetVendor\Doctrine\DBAL\Query\QueryBuilder; +use MailPoetVendor\Doctrine\DBAL\Result; use MailPoetVendor\Doctrine\ORM\EntityManager; use MailPoetVendor\Doctrine\ORM\Query\Expr\Join; use MailPoetVendor\Doctrine\ORM\QueryBuilder as ORMQueryBuilder; @@ -107,7 +107,7 @@ class SegmentSubscribersRepository { $statement = $this->executeQuery($queryBuilder); /** @var string $result */ - $result = $statement->fetchColumn(); + $result = $statement->fetchOne(); return (int)$result; } @@ -458,13 +458,13 @@ class SegmentSubscribersRepository { return $segment; } - private function executeQuery(QueryBuilder $queryBuilder): Statement { - $statement = $queryBuilder->execute(); + private function executeQuery(QueryBuilder $queryBuilder): Result { + $result = $queryBuilder->execute(); // Execute for select always returns statement but PHP Stan doesn't know that :( - if (!$statement instanceof Statement) { + if (!$result instanceof Result) { throw new InvalidStateException('Invalid query.'); } - return $statement; + return $result; } public function getSubscribersGlobalStatusStatisticsCount(SegmentEntity $segment): array { diff --git a/mailpoet/lib/Segments/SegmentsSimpleListRepository.php b/mailpoet/lib/Segments/SegmentsSimpleListRepository.php index 37dca6bf07..fc33d05201 100644 --- a/mailpoet/lib/Segments/SegmentsSimpleListRepository.php +++ b/mailpoet/lib/Segments/SegmentsSimpleListRepository.php @@ -6,7 +6,7 @@ use MailPoet\Entities\SegmentEntity; use MailPoet\Entities\SubscriberEntity; use MailPoet\Subscribers\SubscribersCountsController; use MailPoetVendor\Doctrine\DBAL\Connection; -use MailPoetVendor\Doctrine\DBAL\Driver\Statement; +use MailPoetVendor\Doctrine\DBAL\Result; use MailPoetVendor\Doctrine\ORM\EntityManager; class SegmentsSimpleListRepository { @@ -85,11 +85,11 @@ class SegmentsSimpleListRepository { ->setParameter('typesParam', $segmentTypes, Connection::PARAM_STR_ARRAY); } - $statement = $segmentsDataQuery->execute(); - if (!$statement instanceof Statement) { + $result = $segmentsDataQuery->executeQuery(); + if (!$result instanceof Result) { return []; } - $segments = $statement->fetchAll(); + $segments = $result->fetchAll(); // Fetch subscribers counts for static and dynamic segments and correct data types foreach ($segments as $key => $segment) { @@ -98,6 +98,7 @@ class SegmentsSimpleListRepository { $statisticsKey = $subscriberGlobalStatus ?: 'all'; $segments[$key]['subscribers'] = (int)$this->subscribersCountsController->getSegmentStatisticsCountById($segment['id'])[$statisticsKey]; } + /* @var array */ return $segments; } } diff --git a/mailpoet/lib/Subscribers/EngagementDataBackfiller.php b/mailpoet/lib/Subscribers/EngagementDataBackfiller.php index c8739444c6..7afaa71aee 100644 --- a/mailpoet/lib/Subscribers/EngagementDataBackfiller.php +++ b/mailpoet/lib/Subscribers/EngagementDataBackfiller.php @@ -11,7 +11,7 @@ use MailPoet\Segments\DynamicSegments\Filters\WooFilterHelper; use MailPoet\WooCommerce\Helper; use MailPoetVendor\Carbon\Carbon; use MailPoetVendor\Doctrine\DBAL\Connection; -use MailPoetVendor\Doctrine\DBAL\ForwardCompatibility\Result; +use MailPoetVendor\Doctrine\DBAL\Result; use MailPoetVendor\Doctrine\ORM\EntityManager; class EngagementDataBackfiller { diff --git a/mailpoet/lib/Subscribers/ImportExport/ImportExportRepository.php b/mailpoet/lib/Subscribers/ImportExport/ImportExportRepository.php index 5d47471a0c..9b5df27cd6 100644 --- a/mailpoet/lib/Subscribers/ImportExport/ImportExportRepository.php +++ b/mailpoet/lib/Subscribers/ImportExport/ImportExportRepository.php @@ -13,8 +13,8 @@ use MailPoet\Segments\DynamicSegments\FilterHandler; use MailPoet\Subscribers\SubscriberCustomFieldRepository; use MailPoet\Subscribers\SubscribersRepository; use MailPoetVendor\Doctrine\DBAL\Connection; -use MailPoetVendor\Doctrine\DBAL\Driver\Statement; use MailPoetVendor\Doctrine\DBAL\Query\QueryBuilder; +use MailPoetVendor\Doctrine\DBAL\Result; use MailPoetVendor\Doctrine\ORM\EntityManager; use MailPoetVendor\Doctrine\ORM\Mapping\ClassMetadata; @@ -118,7 +118,7 @@ class ImportExportRepository { }, $columns); foreach ($item as $columnKey => $column) { - $parameters[$paramNames[$columnKey]] = $column; + $parameters[substr($paramNames[$columnKey], 1)] = $column; } $rows[] = "(" . implode(', ', $paramNames) . ")"; } @@ -243,7 +243,7 @@ class ImportExportRepository { } $statement = $qb->execute(); - return $statement instanceof Statement ? $statement->fetchAll() : []; + return $statement instanceof Result ? $statement->fetchAll() : []; } private function createSubscribersQueryBuilder(int $limit, int $offset): QueryBuilder { diff --git a/mailpoet/lib/Subscribers/SubscriberListingRepository.php b/mailpoet/lib/Subscribers/SubscriberListingRepository.php index 920236c5c5..601866a1d6 100644 --- a/mailpoet/lib/Subscribers/SubscriberListingRepository.php +++ b/mailpoet/lib/Subscribers/SubscriberListingRepository.php @@ -10,7 +10,6 @@ use MailPoet\Listing\ListingRepository; use MailPoet\Segments\DynamicSegments\FilterHandler; use MailPoet\Segments\SegmentSubscribersRepository; use MailPoet\Util\Helpers; -use MailPoetVendor\Doctrine\DBAL\Driver\Statement; use MailPoetVendor\Doctrine\DBAL\Query\QueryBuilder as DBALQueryBuilder; use MailPoetVendor\Doctrine\ORM\EntityManager; use MailPoetVendor\Doctrine\ORM\Query\Expr\Join; @@ -79,7 +78,7 @@ class SubscriberListingRepository extends ListingRepository { ->select("count(DISTINCT $subscribersTable.id)") ->from($subscribersTable); $subscribersIdsQuery = $this->applyConstraintsForDynamicSegment($subscribersIdsQuery, $definition, $dynamicSegment); - return (int)$subscribersIdsQuery->execute()->fetchColumn(); + return (int)$subscribersIdsQuery->execute()->fetchOne(); } public function getActionableIds(ListingDefinition $definition): array { @@ -370,12 +369,7 @@ class SubscriberListingRepository extends ListingRepository { $subscribersIdsQuery->setFirstResult($definition->getOffset()); $subscribersIdsQuery->setMaxResults($definition->getLimit()); - $idsStatement = $subscribersIdsQuery->execute(); - // This shouldn't happen because execute on select SQL always returns Statement, but PHPStan doesn't know that - if (!$idsStatement instanceof Statement) { - $queryBuilder->andWhere('0 = 1'); - return; - } + $idsStatement = $subscribersIdsQuery->executeQuery(); $result = $idsStatement->fetchAll(); $ids = array_column($result, 'id'); if (count($ids)) { diff --git a/mailpoet/prefixer/composer.json b/mailpoet/prefixer/composer.json index 7efb209b27..d13dc271b7 100644 --- a/mailpoet/prefixer/composer.json +++ b/mailpoet/prefixer/composer.json @@ -7,9 +7,10 @@ ], "require": { "php": ">=7.4", + "carbonphp/carbon-doctrine-types": "2.*", "cerdic/css-tidy": "2.1.0", "doctrine/common": "3.4.4", - "doctrine/dbal": "2.13.8", + "doctrine/dbal": "3.8.4", "doctrine/orm": "2.13.5", "gregwar/captcha": "1.2.1", "monolog/monolog": "2.9.3", diff --git a/mailpoet/prefixer/composer.lock b/mailpoet/prefixer/composer.lock index f08858b550..46c853c0ce 100644 --- a/mailpoet/prefixer/composer.lock +++ b/mailpoet/prefixer/composer.lock @@ -4,30 +4,30 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8ca3521a9843d1729a1c075f23b8714f", + "content-hash": "0af2d113617c822925327001f144ddce", "packages": [ { "name": "carbonphp/carbon-doctrine-types", - "version": "1.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", - "reference": "3c430083d0b41ceed84ecccf9dac613241d7305d" + "reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/3c430083d0b41ceed84ecccf9dac613241d7305d", - "reference": "3c430083d0b41ceed84ecccf9dac613241d7305d", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/99f76ffa36cce3b70a4a6abce41dba15ca2e84cb", + "reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb", "shasum": "" }, "require": { - "php": "^7.1.8 || ^8.0" + "php": "^7.4 || ^8.0" }, "conflict": { - "doctrine/dbal": ">=3.7.0" + "doctrine/dbal": "<3.7.0 || >=4.0.0" }, "require-dev": { - "doctrine/dbal": ">=2.0.0", + "doctrine/dbal": "^3.7.0", "nesbot/carbon": "^2.71.0 || ^3.0.0", "phpunit/phpunit": "^10.3" }, @@ -57,7 +57,7 @@ ], "support": { "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", - "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/1.0.0" + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/2.1.0" }, "funding": [ { @@ -73,7 +73,7 @@ "type": "tidelift" } ], - "time": "2023-10-01T12:35:29+00:00" + "time": "2023-12-11T17:09:12+00:00" }, { "name": "cerdic/css-tidy", @@ -126,16 +126,16 @@ }, { "name": "doctrine/cache", - "version": "2.1.1", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "331b4d5dbaeab3827976273e9356b3b453c300ce" + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/331b4d5dbaeab3827976273e9356b3b453c300ce", - "reference": "331b4d5dbaeab3827976273e9356b3b453c300ce", + "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb", "shasum": "" }, "require": { @@ -145,18 +145,12 @@ "doctrine/common": ">2.2,<2.4" }, "require-dev": { - "alcaeus/mongo-php-adapter": "^1.1", "cache/integration-tests": "dev-master", - "doctrine/coding-standard": "^8.0", - "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", - "predis/predis": "~1.0", + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", "psr/cache": "^1.0 || ^2.0 || ^3.0", - "symfony/cache": "^4.4 || ^5.2 || ^6.0@dev", - "symfony/var-exporter": "^4.4 || ^5.2 || ^6.0@dev" - }, - "suggest": { - "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" }, "type": "library", "autoload": { @@ -205,7 +199,7 @@ ], "support": { "issues": "https://github.com/doctrine/cache/issues", - "source": "https://github.com/doctrine/cache/tree/2.1.1" + "source": "https://github.com/doctrine/cache/tree/2.2.0" }, "funding": [ { @@ -221,7 +215,7 @@ "type": "tidelift" } ], - "time": "2021-07-17T14:49:29+00:00" + "time": "2022-05-20T20:07:39+00:00" }, { "name": "doctrine/collections", @@ -385,35 +379,40 @@ }, { "name": "doctrine/dbal", - "version": "2.13.8", + "version": "3.8.4", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "dc9b3c3c8592c935a6e590441f9abc0f9eba335b" + "reference": "b05e48a745f722801f55408d0dbd8003b403dbbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/dc9b3c3c8592c935a6e590441f9abc0f9eba335b", - "reference": "dc9b3c3c8592c935a6e590441f9abc0f9eba335b", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/b05e48a745f722801f55408d0dbd8003b403dbbd", + "reference": "b05e48a745f722801f55408d0dbd8003b403dbbd", "shasum": "" }, "require": { - "doctrine/cache": "^1.0|^2.0", - "doctrine/deprecations": "^0.5.3", - "doctrine/event-manager": "^1.0", - "ext-pdo": "*", - "php": "^7.1 || ^8" + "composer-runtime-api": "^2", + "doctrine/cache": "^1.11|^2.0", + "doctrine/deprecations": "^0.5.3|^1", + "doctrine/event-manager": "^1|^2", + "php": "^7.4 || ^8.0", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" }, "require-dev": { - "doctrine/coding-standard": "9.0.0", - "jetbrains/phpstorm-stubs": "2021.1", - "phpstan/phpstan": "1.4.6", - "phpunit/phpunit": "^7.5.20|^8.5|9.5.16", - "psalm/plugin-phpunit": "0.16.1", - "squizlabs/php_codesniffer": "3.6.2", - "symfony/cache": "^4.4", - "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", - "vimeo/psalm": "4.22.0" + "doctrine/coding-standard": "12.0.0", + "fig/log-test": "^1", + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "1.10.58", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "9.6.16", + "psalm/plugin-phpunit": "0.18.4", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.9.0", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/console": "^4.4|^5.4|^6.0|^7.0", + "vimeo/psalm": "4.30.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -424,7 +423,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" + "Doctrine\\DBAL\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -467,14 +466,13 @@ "queryobject", "sasql", "sql", - "sqlanywhere", "sqlite", "sqlserver", "sqlsrv" ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/2.13.8" + "source": "https://github.com/doctrine/dbal/tree/3.8.4" }, "funding": [ { @@ -490,7 +488,7 @@ "type": "tidelift" } ], - "time": "2022-03-09T15:25:46+00:00" + "time": "2024-04-25T07:04:44+00:00" }, { "name": "doctrine/deprecations", @@ -537,37 +535,35 @@ }, { "name": "doctrine/event-manager", - "version": "1.1.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/event-manager.git", - "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f" + "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/41370af6a30faa9dc0368c4a6814d596e81aba7f", - "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520", + "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520", "shasum": "" }, "require": { + "doctrine/deprecations": "^0.5.3 || ^1", "php": "^7.1 || ^8.0" }, "conflict": { - "doctrine/common": "<2.9@dev" + "doctrine/common": "<2.9" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpunit/phpunit": "^7.0" + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.8", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.24" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common" + "Doctrine\\Common\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -611,7 +607,7 @@ ], "support": { "issues": "https://github.com/doctrine/event-manager/issues", - "source": "https://github.com/doctrine/event-manager/tree/1.1.x" + "source": "https://github.com/doctrine/event-manager/tree/1.2.0" }, "funding": [ { @@ -627,32 +623,32 @@ "type": "tidelift" } ], - "time": "2020-05-29T18:28:51+00:00" + "time": "2022-10-12T20:51:15+00:00" }, { "name": "doctrine/inflector", - "version": "2.0.4", + "version": "2.0.10", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89" + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", - "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", - "vimeo/psalm": "^4.10" + "doctrine/coding-standard": "^11.0", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^8.5 || ^9.5", + "vimeo/psalm": "^4.25 || ^5.4" }, "type": "library", "autoload": { @@ -702,7 +698,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.4" + "source": "https://github.com/doctrine/inflector/tree/2.0.10" }, "funding": [ { @@ -718,34 +714,34 @@ "type": "tidelift" } ], - "time": "2021-10-22T20:16:43+00:00" + "time": "2024-02-18T20:23:39+00:00" }, { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -772,7 +768,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -788,7 +784,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "doctrine/lexer", @@ -1714,43 +1710,46 @@ }, { "name": "symfony/console", - "version": "v4.4.38", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "5a50085bf5460f0c0d60a50b58388c1249826b8a" + "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5a50085bf5460f0c0d60a50b58388c1249826b8a", - "reference": "5a50085bf5460f0c0d60a50b58388c1249826b8a", + "url": "https://api.github.com/repos/symfony/console/zipball/aa73115c0c24220b523625bfcfa655d7d73662dd", + "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd", "shasum": "" }, "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php73": "^1.9", "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2" + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" }, "conflict": { "psr/log": ">=3", - "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3|>=5", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", "symfony/lock": "<4.4", - "symfony/process": "<3.3" + "symfony/process": "<4.4" }, "provide": { "psr/log-implementation": "1.0|2.0" }, "require-dev": { "psr/log": "^1|^2", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/event-dispatcher": "^4.3", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^3.4|^4.0|^5.0", - "symfony/var-dumper": "^4.3|^5.0" + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, "suggest": { "psr/log": "For using the console logger", @@ -1783,8 +1782,14 @@ ], "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], "support": { - "source": "https://github.com/symfony/console/tree/v4.4.38" + "source": "https://github.com/symfony/console/tree/v5.4.40" }, "funding": [ { @@ -1800,7 +1805,7 @@ "type": "tidelift" } ], - "time": "2022-01-30T21:23:57+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/css-selector", @@ -2245,6 +2250,84 @@ ], "time": "2020-07-14T12:35:20+00:00" }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, { "name": "symfony/polyfill-intl-idn", "version": "v1.18.1", @@ -2961,6 +3044,92 @@ ], "time": "2021-11-04T13:32:43+00:00" }, + { + "name": "symfony/string", + "version": "v5.4.40", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "142877285aa974a6f7685e292ab5ba9aae86b143" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/142877285aa974a6f7685e292ab5ba9aae86b143", + "reference": "142877285aa974a6f7685e292ab5ba9aae86b143", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.40" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T14:33:22+00:00" + }, { "name": "symfony/translation", "version": "v4.4.37", diff --git a/mailpoet/prefixer/fix-doctrine.php b/mailpoet/prefixer/fix-doctrine.php index e526c53930..10a436aef3 100755 --- a/mailpoet/prefixer/fix-doctrine.php +++ b/mailpoet/prefixer/fix-doctrine.php @@ -25,23 +25,6 @@ $php7CachedItem = file_get_contents(__DIR__ . "/../vendor-prefixed/doctrine/cach $php7CachedItem = str_replace('final class CacheItem', 'final class TypedCacheItem', $php7CachedItem); file_put_contents(__DIR__ . "/../vendor-prefixed/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/TypedCacheItem.php", $php7CachedItem); -// Replace PHP8 syntax in ReflectionReadonlyProperty. -// The class is used only in PHP8.1 but it fail to pass pre-commit checks in the plugin repository -// See https://github.com/doctrine/orm/commit/580b9196e65adaacc05b9f7a50654739ad995597#diff-732e324167dd49e48b221477c3e0f6d7934f3eb5ec0970dbf1c06f6c7df15398R3790-R3793 -$readonlyProxy = file_get_contents(__DIR__ . "/../vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Mapping/ReflectionReadonlyProperty.php"); -$readonlyProxy = str_replace( - [ - 'public function __construct(private ReflectionProperty $wrappedProperty)', - 'parent::__construct($wrappedProperty->class, $wrappedProperty->name);', - ], - [ - "/** @var ReflectionProperty */\n private \$wrappedProperty;\n\n public function __construct(ReflectionProperty \$wrappedProperty)", - "\$this->wrappedProperty = \$wrappedProperty;\n parent::__construct(\$wrappedProperty->class, \$wrappedProperty->name);", - ], - $readonlyProxy -); -file_put_contents(__DIR__ . "/../vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Mapping/ReflectionReadonlyProperty.php", $readonlyProxy); - // cleanup file types by extension exec('find ' . __DIR__ . "/../vendor-prefixed/doctrine -type f -name '*.xsd' -delete"); @@ -54,75 +37,46 @@ exec('find ' . __DIR__ . "/../vendor-prefixed/doctrine -type f -name 'README.mar // cleanup Doctrine DBAL exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/bin'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Connections'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractOracleDriver'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOIbm'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOOracle'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLAnywhere'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Schema'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Sharding'); -exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Tools'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractDB2Driver.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractOracleDriver.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLAnywhereDriver.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLServerDriver.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/ConnectionEventArgs.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableEventArgs.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRemoveColumnEventArgs.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRenameColumnEventArgs.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaColumnDefinitionEventArgs.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableColumnEventArgs.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableEventArgs.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaDropTableEventArgs.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaEventArgs.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaIndexDefinitionEventArgs.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL91Keywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL92Keywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL94Keywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL100Keywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQLKeywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLAnywhere11Keywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLAnywhere12Keywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLAnywhere16Keywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLAnywhereKeywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2005Keywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2008Keywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2012Keywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLServerKeywords.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/OraclePlatform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSQL91Platform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSQL92Platform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSQL94Platform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSQL100Platform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLAnywhere11Platform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLAnywhere12Platform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLAnywhere16Platform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLAzurePlatform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2012Platform.php'); -exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php'); +exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Connections'); +exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Driver/AbstractOracleDriver'); +exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Driver/IBMDB2'); +exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Driver/Mysqli'); +exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Driver/OCI8'); +exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Driver/SQLSrv'); +exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Tools'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Driver/AbstractDB2Driver.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Driver/AbstractOracleDriver.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Event/ConnectionEventArgs.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Event/Listeners/OracleSessionInit.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Event/SchemaAlterTableAddColumnEventArgs.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Event/SchemaAlterTableChangeColumnEventArgs.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Event/SchemaAlterTableEventArgs.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Event/SchemaAlterTableRemoveColumnEventArgs.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Event/SchemaAlterTableRenameColumnEventArgs.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Event/SchemaColumnDefinitionEventArgs.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Event/SchemaCreateTableColumnEventArgs.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Event/SchemaCreateTableEventArgs.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Event/SchemaDropTableEventArgs.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Event/SchemaEventArgs.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Event/SchemaIndexDefinitionEventArgs.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/DB2Platform.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/Keywords/DB2Keywords.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/Keywords/OracleKeywords.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/Keywords/PostgreSQL94Keywords.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/Keywords/PostgreSQL100Keywords.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/Keywords/PostgreSQLKeywords.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/Keywords/SQLiteKeywords.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/Keywords/SQLServer2012Keywords.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/Keywords/SQLServerKeywords.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/OraclePlatform.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/PostgreSQL94Platform.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/PostgreSQL100Platform.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/PostgreSqlPlatform.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/SqlitePlatform.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/SQLServer2012Platform.php'); +exec('rm ' . __DIR__ . '/../vendor-prefixed/doctrine/dbal/src/Platforms/SQLServerPlatform.php'); // cleanup Doctrine ORM exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/orm/bin'); @@ -147,3 +101,56 @@ exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/instantiator/docs'); exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/persistence/tests_php74'); exec('rm -r ' . __DIR__ . '/../vendor-prefixed/doctrine/persistence/tests_php81'); exec('rm -r ' . __DIR__ . '/../vendor-prefixed/symfony/console'); + +// Removing #[\SensitiveParameter] attribute because it can break the plugin on PHP 7.4 +$attributeReplacement = [ + 'find' => [ + '#[\SensitiveParameter]', + ], + 'replace' => [ + '', + ], +]; +$files = [ + '../vendor-prefixed/doctrine/dbal/src/Connection.php', + '../vendor-prefixed/doctrine/dbal/src/Driver.php', + '../vendor-prefixed/doctrine/dbal/src/Driver/AbstractSQLiteDriver/Middleware/EnableForeignKeys.php', + '../vendor-prefixed/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php', + '../vendor-prefixed/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php', + '../vendor-prefixed/doctrine/dbal/src/Driver/PDO/OCI/Driver.php', + '../vendor-prefixed/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php', + '../vendor-prefixed/doctrine/dbal/src/Driver/PDO/SQLSrv/Driver.php', + '../vendor-prefixed/doctrine/dbal/src/Driver/PDO/SQLite/Driver.php', + '../vendor-prefixed/doctrine/dbal/src/Driver/PgSQL/Driver.php', + '../vendor-prefixed/doctrine/dbal/src/Driver/SQLite3/Driver.php', + '../vendor-prefixed/doctrine/dbal/src/DriverManager.php', + '../vendor-prefixed/doctrine/dbal/src/Exception.php', + '../vendor-prefixed/doctrine/dbal/src/Logging/Driver.php', + '../vendor-prefixed/doctrine/dbal/src/Portability/Driver.php', +]; + +$replacements = [ + [ + 'file' => '../vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Mapping/ReflectionReadonlyProperty.php', + 'find' => [ + 'private ReflectionProperty', + ], + 'replace' => [ + 'ReflectionProperty', + ], + ], +]; + +foreach ($files as $file) { + $replacements[] = [ + 'file' => $file, + 'find' => $attributeReplacement['find'], + 'replace' => $attributeReplacement['replace'], + ]; +} + +foreach ($replacements as $singleFile) { + $data = file_get_contents($singleFile['file']); + $data = str_replace($singleFile['find'], $singleFile['replace'], $data); + file_put_contents($singleFile['file'], $data); +} diff --git a/mailpoet/prefixer/fix-symfony-polyfill.php b/mailpoet/prefixer/fix-symfony-polyfill.php index 9569be3234..240b97cd3f 100644 --- a/mailpoet/prefixer/fix-symfony-polyfill.php +++ b/mailpoet/prefixer/fix-symfony-polyfill.php @@ -29,6 +29,14 @@ $data = file_get_contents($file); $data = str_replace('\\Normalizer::', '\\MailPoetVendor\\Normalizer::', $data); file_put_contents($file, $data); +// Make the polyfill compatible with PHP 7.4 +$file = __DIR__ . '/../vendor-prefixed/symfony/polyfill-intl-grapheme/bootstrap80.php'; +$data = file_get_contents($file); +$data = str_replace(') : string|false', ')', $data); +$data = str_replace(') : int|false|null', ')', $data); +$data = str_replace(') : int|false', ')', $data); +file_put_contents($file, $data); + // Remove unnecessary polyfills these polyfills are required by symfony/console // but don't use and remove the package exec('rm -r ' . __DIR__ . '/../vendor-prefixed/symfony/polyfill-php73'); diff --git a/mailpoet/tasks/phpstan/phpstan-7-baseline.neon b/mailpoet/tasks/phpstan/phpstan-7-baseline.neon index 89e940d7e2..1c5f0470f2 100644 --- a/mailpoet/tasks/phpstan/phpstan-7-baseline.neon +++ b/mailpoet/tasks/phpstan/phpstan-7-baseline.neon @@ -131,7 +131,7 @@ parameters: path: ../../lib/Cache/TransientCache.php - - message: "#^Parameter \\#1 \\$pdo of method MailPoet\\\\Config\\\\Database\\:\\:init\\(\\) expects PDO, MailPoetVendor\\\\Doctrine\\\\DBAL\\\\Driver\\\\Connection given\\.$#" + message: "#^Parameter \\#1 \\$pdo of method MailPoet\\\\Config\\\\Database\\:\\:init\\(\\) expects PDO, object\\|resource given\\.$#" count: 1 path: ../../lib/Config/DatabaseInitializer.php @@ -226,15 +226,10 @@ parameters: path: ../../lib/Doctrine/TablePrefixMetadataFactory.php - - message: "#^Cannot cast mixed to int\\.$#" + message: "#^Method MailPoet\\\\Doctrine\\\\Types\\\\BigIntType\\:\\:convertToPHPValue\\(\\) should return string\\|null but returns int\\|null\\.$#" count: 1 path: ../../lib/Doctrine/Types/BigIntType.php - - - message: "#^Parameter \\#1 \\$date of static method MailPoetVendor\\\\Carbon\\\\Carbon\\:\\:instance\\(\\) expects DateTimeInterface, mixed given\\.$#" - count: 1 - path: ../../lib/Doctrine/Types/DateTimeTzToStringType.php - - message: "#^Parameter \\#1 \\$data of function is_serialized expects string, mixed given\\.$#" count: 1 @@ -566,7 +561,7 @@ parameters: path: ../../lib/Segments/SegmentsSimpleListRepository.php - - message: "#^Method MailPoet\\\\Segments\\\\SegmentsSimpleListRepository\\:\\:getList\\(\\) should return array\\ but returns array\\.$#" + message: "#^Method MailPoet\\\\Segments\\\\SegmentsSimpleListRepository\\:\\:getList\\(\\) should return array\\ but returns array\\\\.$#" count: 1 path: ../../lib/Segments/SegmentsSimpleListRepository.php @@ -800,3 +795,8 @@ parameters: message: "#^Binary operation \"\\.\" between non-falsy-string and string\\|Stringable results in an error\\.$#" count: 1 path: ../../lib/Doctrine/Validator/ValidationException.php + + - + message: "#^Parameter \\#1 \\$params of method MailPoetVendor\\\\Doctrine\\\\DBAL\\\\Connection\\:\\:__construct\\(\\) expects array\\{application_name\\?\\: string, charset\\?\\: string, dbname\\?\\: string, defaultTableOptions\\?\\: array\\, default_dbname\\?\\: string, driver\\?\\: 'ibm_db2'\\|'mysqli'\\|'oci8'\\|'pdo_mysql'\\|'pdo_oci'\\|'pdo_pgsql'\\|'pdo_sqlite'\\|'pdo_sqlsrv'\\|'pgsql'\\|'sqlite3'\\|'sqlsrv', driverClass\\?\\: class-string\\, driverOptions\\?\\: array, \\.\\.\\.\\}, array\\ given\\.$#" + count: 1 + path: ../../lib/Doctrine/SerializableConnection.php diff --git a/mailpoet/tasks/phpstan/phpstan-8-baseline.neon b/mailpoet/tasks/phpstan/phpstan-8-baseline.neon index 9b332089c5..2f01a59f8e 100644 --- a/mailpoet/tasks/phpstan/phpstan-8-baseline.neon +++ b/mailpoet/tasks/phpstan/phpstan-8-baseline.neon @@ -131,7 +131,7 @@ parameters: path: ../../lib/Cache/TransientCache.php - - message: "#^Parameter \\#1 \\$pdo of method MailPoet\\\\Config\\\\Database\\:\\:init\\(\\) expects PDO, MailPoetVendor\\\\Doctrine\\\\DBAL\\\\Driver\\\\Connection given\\.$#" + message: "#^Parameter \\#1 \\$pdo of method MailPoet\\\\Config\\\\Database\\:\\:init\\(\\) expects PDO, object\\|resource given\\.$#" count: 1 path: ../../lib/Config/DatabaseInitializer.php @@ -226,15 +226,10 @@ parameters: path: ../../lib/Doctrine/TablePrefixMetadataFactory.php - - message: "#^Cannot cast mixed to int\\.$#" + message: "#^Method MailPoet\\\\Doctrine\\\\Types\\\\BigIntType\\:\\:convertToPHPValue\\(\\) should return string\\|null but returns int\\|null\\.$#" count: 1 path: ../../lib/Doctrine/Types/BigIntType.php - - - message: "#^Parameter \\#1 \\$date of static method MailPoetVendor\\\\Carbon\\\\Carbon\\:\\:instance\\(\\) expects DateTimeInterface, mixed given\\.$#" - count: 1 - path: ../../lib/Doctrine/Types/DateTimeTzToStringType.php - - message: "#^Parameter \\#1 \\$data of function is_serialized expects string, mixed given\\.$#" count: 1 @@ -556,7 +551,7 @@ parameters: path: ../../lib/Segments/SegmentsSimpleListRepository.php - - message: "#^Method MailPoet\\\\Segments\\\\SegmentsSimpleListRepository\\:\\:getList\\(\\) should return array\\ but returns array\\.$#" + message: "#^Method MailPoet\\\\Segments\\\\SegmentsSimpleListRepository\\:\\:getList\\(\\) should return array\\ but returns array\\\\.$#" count: 1 path: ../../lib/Segments/SegmentsSimpleListRepository.php @@ -794,3 +789,8 @@ parameters: message: "#^Parameter \\#1 \\$args of function get_terms expects array\\{taxonomy\\?\\: array\\\\|string, object_ids\\?\\: array\\\\|int, orderby\\?\\: string, order\\?\\: string, hide_empty\\?\\: bool\\|int, include\\?\\: array\\\\|string, exclude\\?\\: array\\\\|string, exclude_tree\\?\\: array\\\\|string, \\.\\.\\.\\}, array\\|string given\\.$#" count: 1 path: ../../lib/Automation/Engine/WordPress.php + + - + message: "#^Parameter \\#1 \\$params of method MailPoetVendor\\\\Doctrine\\\\DBAL\\\\Connection\\:\\:__construct\\(\\) expects array\\{application_name\\?\\: string, charset\\?\\: string, dbname\\?\\: string, defaultTableOptions\\?\\: array\\, default_dbname\\?\\: string, driver\\?\\: 'ibm_db2'\\|'mysqli'\\|'oci8'\\|'pdo_mysql'\\|'pdo_oci'\\|'pdo_pgsql'\\|'pdo_sqlite'\\|'pdo_sqlsrv'\\|'pgsql'\\|'sqlite3'\\|'sqlsrv', driverClass\\?\\: class-string\\, driverOptions\\?\\: array, \\.\\.\\.\\}, array\\ given\\.$#" + count: 1 + path: ../../lib/Doctrine/SerializableConnection.php diff --git a/mailpoet/tests/_support/IntegrationTester.php b/mailpoet/tests/_support/IntegrationTester.php index f16f15566f..b1dcfffbc3 100644 --- a/mailpoet/tests/_support/IntegrationTester.php +++ b/mailpoet/tests/_support/IntegrationTester.php @@ -18,8 +18,8 @@ use MailPoet\Segments\DynamicSegments\Filters\Filter; use MailPoet\Util\Security; use MailPoet\WooCommerce\Helper; use MailPoetVendor\Carbon\Carbon; -use MailPoetVendor\Doctrine\DBAL\Driver\Statement; use MailPoetVendor\Doctrine\DBAL\Query\QueryBuilder; +use MailPoetVendor\Doctrine\DBAL\Result; use MailPoetVendor\Doctrine\ORM\EntityManager; require_once(ABSPATH . 'wp-admin/includes/user.php'); @@ -449,7 +449,7 @@ class IntegrationTester extends \Codeception\Actor { */ public function getSubscriberEmailsFromQueryBuilder(QueryBuilder $queryBuilder): array { $statement = $queryBuilder->execute(); - $results = $statement instanceof Statement ? $statement->fetchAllAssociative() : []; + $results = $statement instanceof Result ? $statement->fetchAllAssociative() : []; return array_map(function($row) { $subscriber = $this->entityManager->find(SubscriberEntity::class, $row['inner_subscriber_id']); if (!$subscriber instanceof SubscriberEntity) { diff --git a/mailpoet/tests/integration/API/JSON/v1/ImportExportTest.php b/mailpoet/tests/integration/API/JSON/v1/ImportExportTest.php index a17a54a6b6..f1e6bc9d6b 100644 --- a/mailpoet/tests/integration/API/JSON/v1/ImportExportTest.php +++ b/mailpoet/tests/integration/API/JSON/v1/ImportExportTest.php @@ -25,7 +25,7 @@ class ImportExportTest extends \MailPoetTest { $this->entityManager->createQueryBuilder() ->delete(ScheduledTaskEntity::class, 's') ->where('s.type = :type') - ->setParameter(':type', WooCommerceSync::TASK_TYPE) + ->setParameter('type', WooCommerceSync::TASK_TYPE) ->getQuery() ->execute(); } diff --git a/mailpoet/tests/integration/Config/DatabaseTest.php b/mailpoet/tests/integration/Config/DatabaseTest.php index 2cdea55c09..8817dab43c 100644 --- a/mailpoet/tests/integration/Config/DatabaseTest.php +++ b/mailpoet/tests/integration/Config/DatabaseTest.php @@ -30,7 +30,7 @@ class DatabaseTest extends \MailPoetTest { public function testItSetsDBDriverOptions() { $connection = $this->diContainer->get(Connection::class); - $this->database->init($connection->getWrappedConnection()); + $this->database->init($connection->getNativeConnection()); $result = ORM::for_table("") ->raw_query( 'SELECT ' . diff --git a/mailpoet/tests/integration/Doctrine/ConnectionFactoryTest.php b/mailpoet/tests/integration/Doctrine/ConnectionFactoryTest.php index 311ecfd7bc..dad72fe88c 100644 --- a/mailpoet/tests/integration/Doctrine/ConnectionFactoryTest.php +++ b/mailpoet/tests/integration/Doctrine/ConnectionFactoryTest.php @@ -7,8 +7,8 @@ use MailPoet\Doctrine\ConnectionFactory; use MailPoet\Doctrine\SerializableConnection; use MailPoet\Doctrine\Types\JsonOrSerializedType; use MailPoet\Doctrine\Types\JsonType; -use MailPoetVendor\Doctrine\DBAL\Driver\PDOMySql; -use MailPoetVendor\Doctrine\DBAL\Platforms\MySqlPlatform; +use MailPoetVendor\Doctrine\DBAL\Driver\PDO\MySQL; +use MailPoetVendor\Doctrine\DBAL\Platforms\MySQLPlatform; use MailPoetVendor\Doctrine\DBAL\Types\Type; use PDO; @@ -29,9 +29,9 @@ class ConnectionFactoryTest extends \MailPoetTest { $connection = $connectionFactory->createConnection(); verify($connection)->instanceOf(SerializableConnection::class); - verify($connection->getWrappedConnection())->instanceOf(PDO::class); - verify($connection->getDriver())->instanceOf(PDOMySql\Driver::class); - verify($connection->getDatabasePlatform())->instanceOf(MySqlPlatform::class); + verify($connection->getNativeConnection())->instanceOf(PDO::class); + verify($connection->getDriver())->instanceOf(MySQL\Driver::class); + verify($connection->getDatabasePlatform())->instanceOf(MySQLPlatform::class); $params = $connection->getParams(); verify($params['host'])->equals(Env::$dbHost); verify($params)->arrayNotContains('unix_socket'); @@ -92,7 +92,7 @@ class ConnectionFactoryTest extends \MailPoetTest { Env::$dbHost = '::ffff:' . gethostbyname($this->envBackup['db_host']); $connectionFactory = new ConnectionFactory(); $connection = $connectionFactory->createConnection(); - verify($connection->getWrappedConnection())->instanceOf(PDO::class); + verify($connection->getNativeConnection())->instanceOf(PDO::class); verify($connection->executeQuery('SELECT "abc"')->fetchOne())->same('abc'); } @@ -128,7 +128,7 @@ class ConnectionFactoryTest extends \MailPoetTest { 'minWaitTimeout' => 1, ]); $connection = $connectionFactory->createConnection(); - $current = $connection->executeQuery('SELECT @@session.wait_timeout')->fetchColumn(); + $current = $connection->executeQuery('SELECT @@session.wait_timeout')->fetchOne(); verify($current)->greaterThan(1); // timeout will be set to higher value @@ -136,7 +136,7 @@ class ConnectionFactoryTest extends \MailPoetTest { 'minWaitTimeout' => 999999, ]); $connection = $connectionFactory->createConnection(); - $current = $connection->executeQuery('SELECT @@session.wait_timeout')->fetchColumn(); + $current = $connection->executeQuery('SELECT @@session.wait_timeout')->fetchOne(); verify($current)->equals(999999); } diff --git a/mailpoet/tests/integration/Segments/DynamicSegments/FilterHandlerTest.php b/mailpoet/tests/integration/Segments/DynamicSegments/FilterHandlerTest.php index 6aab4be0bf..6db03ad43c 100644 --- a/mailpoet/tests/integration/Segments/DynamicSegments/FilterHandlerTest.php +++ b/mailpoet/tests/integration/Segments/DynamicSegments/FilterHandlerTest.php @@ -9,8 +9,8 @@ use MailPoet\Entities\SubscriberEntity; use MailPoet\Segments\DynamicSegments\Filters\UserRole; use MailPoet\Subscribers\SubscribersRepository; use MailPoetVendor\Carbon\Carbon; -use MailPoetVendor\Doctrine\DBAL\Driver\Statement; use MailPoetVendor\Doctrine\DBAL\Query\QueryBuilder; +use MailPoetVendor\Doctrine\DBAL\Result; class FilterHandlerTest extends \MailPoetTest { @@ -45,7 +45,7 @@ class FilterHandlerTest extends \MailPoetTest { public function testItAppliesFilter(): void { $segment = $this->getSegment('editor'); $statement = $this->filterHandler->apply($this->getQueryBuilder(), $segment)->execute(); - $this->assertInstanceOf(Statement::class, $statement); + $this->assertInstanceOf(Result::class, $statement); $result = $statement->fetchAll(); verify($result)->arrayCount(2); $this->assertIsArray($result[0]);