diff --git a/mailpoet/lib/Models/DynamicSegmentFilter.php b/mailpoet/lib/Models/DynamicSegmentFilter.php deleted file mode 100644 index ff6185ac77..0000000000 --- a/mailpoet/lib/Models/DynamicSegmentFilter.php +++ /dev/null @@ -1,74 +0,0 @@ -filterData)) { - $this->filterData = []; - } - - if (!WPFunctions::get()->isSerialized($this->filterData)) { - $this->filterData = serialize($this->filterData); - } - - return parent::save(); - } - - public static function getAllBySegmentIds($segmentIds) { - self::deprecationError(__METHOD__); - if (empty($segmentIds)) return []; - $query = self::tableAlias('filters') - ->whereIn('filters.segment_id', $segmentIds); - - $query->findMany(); - return $query->findMany(); - } - - public function __get($name) { - self::deprecationError($name); - $name = Helpers::camelCaseToUnderscore($name); - $value = parent::__get($name); - if ($name === 'filter_data' && $value !== null && WPFunctions::get()->isSerialized($value)) { - return unserialize($value); - } - return $value; - } - - /** - * @deprecated This is here for displaying the deprecation warning for static calls. - */ - public static function __callStatic($name, $arguments) { - self::deprecationError($name); - return parent::__callStatic($name, $arguments); - } - - public static function deleteAllBySegmentIds($segmentIds) { - self::deprecationError(__METHOD__); - if (empty($segmentIds)) return; - - $query = self::tableAlias('filters') - ->whereIn('segment_id', $segmentIds); - - $query->deleteMany(); - - } - - private static function deprecationError($methodName) { - trigger_error(' Calling ' . esc_html($methodName) . ' is deprecated and will be removed. Use \MailPoet\Segments\DynamicSegments\DynamicSegmentFilterRepository and respective Doctrine entities instead.', E_USER_DEPRECATED); - } -} diff --git a/mailpoet/lib/Models/MappingToExternalEntities.php b/mailpoet/lib/Models/MappingToExternalEntities.php deleted file mode 100644 index 9f803fbdee..0000000000 --- a/mailpoet/lib/Models/MappingToExternalEntities.php +++ /dev/null @@ -1,38 +0,0 @@ -hydrate($data); - return $relation->save(); - } - - private static function deprecationError($methodName) { - trigger_error(' Calling ' . esc_html($methodName) . ' is deprecated and will be removed. There is no replacement.', E_USER_DEPRECATED); - } -} diff --git a/mailpoet/lib/Models/StatisticsClicks.php b/mailpoet/lib/Models/StatisticsClicks.php deleted file mode 100644 index 948c1fd5b4..0000000000 --- a/mailpoet/lib/Models/StatisticsClicks.php +++ /dev/null @@ -1,41 +0,0 @@ -where('newsletter_id', $newsletterId) - ->where('queue_id', $queueId) - ->findOne(); - if (!$statistics) { - $statistics = self::create(); - $statistics->subscriberId = $subscriberId; - $statistics->newsletterId = $newsletterId; - $statistics->queueId = $queueId; - $statistics->save(); - } - return $statistics; - } - - /** - * @deprecated This is here for displaying the deprecation warning for properties. - */ - public function __get($key) { - self::deprecationError('property "' . $key . '"'); - return parent::__get($key); - } - - /** - * @deprecated This is here for displaying the deprecation warning for static calls. - */ - public static function __callStatic($name, $arguments) { - self::deprecationError($name); - return parent::__callStatic($name, $arguments); - } - - private static function deprecationError($methodName) { - trigger_error( - 'Calling ' . esc_html($methodName) . ' is deprecated and will be removed. Use \MailPoet\Statistics\StatisticsOpensRepository and \MailPoet\Entities\StatisticsOpenEntity.', - E_USER_DEPRECATED - ); - } -} diff --git a/mailpoet/lib/Models/StatisticsWooCommercePurchases.php b/mailpoet/lib/Models/StatisticsWooCommercePurchases.php deleted file mode 100644 index a13d543368..0000000000 --- a/mailpoet/lib/Models/StatisticsWooCommercePurchases.php +++ /dev/null @@ -1,42 +0,0 @@ -, array\\\\|string\\> given\\.$#" count: 1 diff --git a/mailpoet/tasks/phpstan/phpstan-8-baseline.neon b/mailpoet/tasks/phpstan/phpstan-8-baseline.neon index cbc9c1cccd..ad335ff5ef 100644 --- a/mailpoet/tasks/phpstan/phpstan-8-baseline.neon +++ b/mailpoet/tasks/phpstan/phpstan-8-baseline.neon @@ -310,11 +310,6 @@ parameters: count: 1 path: ../../lib/Listing/ListingRepository.php - - - message: "#^Method MailPoet\\\\Models\\\\DynamicSegmentFilter\\:\\:__get\\(\\) should return string\\|null but returns mixed\\.$#" - count: 1 - path: ../../lib/Models/DynamicSegmentFilter.php - - message: "#^Parameter \\#2 \\$array of function implode expects array\\, array\\\\|string\\> given\\.$#" count: 1 diff --git a/mailpoet/tasks/phpstan/phpstan-8.1-baseline.neon b/mailpoet/tasks/phpstan/phpstan-8.1-baseline.neon index c3354a593a..61a756e95c 100644 --- a/mailpoet/tasks/phpstan/phpstan-8.1-baseline.neon +++ b/mailpoet/tasks/phpstan/phpstan-8.1-baseline.neon @@ -309,11 +309,6 @@ parameters: count: 1 path: ../../lib/Listing/ListingRepository.php - - - message: "#^Method MailPoet\\\\Models\\\\DynamicSegmentFilter\\:\\:__get\\(\\) should return string\\|null but returns mixed\\.$#" - count: 1 - path: ../../lib/Models/DynamicSegmentFilter.php - - message: "#^Parameter \\#2 \\$array of function implode expects array\\, array\\\\|string\\> given\\.$#" count: 1