diff --git a/mailpoet/lib/Newsletter/NewslettersRepository.php b/mailpoet/lib/Newsletter/NewslettersRepository.php index 1c61b04a93..2b66a5b80f 100644 --- a/mailpoet/lib/Newsletter/NewslettersRepository.php +++ b/mailpoet/lib/Newsletter/NewslettersRepository.php @@ -404,8 +404,8 @@ class NewslettersRepository extends Repository { /** * @return NewsletterEntity[] */ - public function findSendigNotificationHistoryWithPausedTask(NewsletterEntity $newsletter): array { - $result = $this->entityManager->createQueryBuilder() + public function findSendingNotificationHistoryWithoutPausedTask(NewsletterEntity $newsletter): array { + return $this->entityManager->createQueryBuilder() ->select('n') ->from(NewsletterEntity::class, 'n') ->join('n.queues', 'q') @@ -418,8 +418,7 @@ class NewslettersRepository extends Repository { ->setParameter('type', NewsletterEntity::TYPE_NOTIFICATION_HISTORY) ->setParameter('status', NewsletterEntity::STATUS_SENDING) ->setParameter('taskStatus', ScheduledTaskEntity::STATUS_PAUSED) - ->getQuery()->execute(); - return $result; + ->getQuery()->getResult(); } /** diff --git a/mailpoet/lib/Newsletter/Scheduler/PostNotificationScheduler.php b/mailpoet/lib/Newsletter/Scheduler/PostNotificationScheduler.php index c63db612b4..3fb80bcfdf 100644 --- a/mailpoet/lib/Newsletter/Scheduler/PostNotificationScheduler.php +++ b/mailpoet/lib/Newsletter/Scheduler/PostNotificationScheduler.php @@ -110,7 +110,7 @@ class PostNotificationScheduler { } public function createPostNotificationSendingTask(NewsletterEntity $newsletter): ?ScheduledTaskEntity { - $notificationHistory = $this->newslettersRepository->findSendigNotificationHistoryWithPausedTask($newsletter); + $notificationHistory = $this->newslettersRepository->findSendingNotificationHistoryWithoutPausedTask($newsletter); if (count($notificationHistory) > 0) { return null; } diff --git a/mailpoet/tasks/phpstan/phpstan-7-baseline.neon b/mailpoet/tasks/phpstan/phpstan-7-baseline.neon index f4d2f938a1..89e6e5e0c1 100644 --- a/mailpoet/tasks/phpstan/phpstan-7-baseline.neon +++ b/mailpoet/tasks/phpstan/phpstan-7-baseline.neon @@ -485,11 +485,6 @@ parameters: count: 2 path: ../../lib/Newsletter/NewslettersRepository.php - - - message: "#^Method MailPoet\\\\Newsletter\\\\NewslettersRepository\\:\\:findSendigNotificationHistoryWithPausedTask\\(\\) should return array\\ but returns mixed\\.$#" - count: 1 - path: ../../lib/Newsletter/NewslettersRepository.php - - message: "#^Method MailPoet\\\\Newsletter\\\\Renderer\\\\Renderer\\:\\:postProcessTemplate\\(\\) should return string but returns mixed\\.$#" count: 1 diff --git a/mailpoet/tasks/phpstan/phpstan-8-baseline.neon b/mailpoet/tasks/phpstan/phpstan-8-baseline.neon index 82167c3a63..9ffc985cf4 100644 --- a/mailpoet/tasks/phpstan/phpstan-8-baseline.neon +++ b/mailpoet/tasks/phpstan/phpstan-8-baseline.neon @@ -485,11 +485,6 @@ parameters: count: 2 path: ../../lib/Newsletter/NewslettersRepository.php - - - message: "#^Method MailPoet\\\\Newsletter\\\\NewslettersRepository\\:\\:findSendigNotificationHistoryWithPausedTask\\(\\) should return array\\ but returns mixed\\.$#" - count: 1 - path: ../../lib/Newsletter/NewslettersRepository.php - - message: "#^Method MailPoet\\\\Newsletter\\\\Renderer\\\\Renderer\\:\\:postProcessTemplate\\(\\) should return string but returns mixed\\.$#" count: 1 diff --git a/mailpoet/tasks/phpstan/phpstan-8.1-baseline.neon b/mailpoet/tasks/phpstan/phpstan-8.1-baseline.neon index b75751d4f0..a4f8a32ce5 100644 --- a/mailpoet/tasks/phpstan/phpstan-8.1-baseline.neon +++ b/mailpoet/tasks/phpstan/phpstan-8.1-baseline.neon @@ -484,11 +484,6 @@ parameters: count: 2 path: ../../lib/Newsletter/NewslettersRepository.php - - - message: "#^Method MailPoet\\\\Newsletter\\\\NewslettersRepository\\:\\:findSendigNotificationHistoryWithPausedTask\\(\\) should return array\\ but returns mixed\\.$#" - count: 1 - path: ../../lib/Newsletter/NewslettersRepository.php - - message: "#^Method MailPoet\\\\Newsletter\\\\Renderer\\\\Renderer\\:\\:postProcessTemplate\\(\\) should return string but returns mixed\\.$#" count: 1