Rename method in repository

[MAILPOET-4685]
This commit is contained in:
Jan Lysý
2022-09-29 14:58:05 +02:00
committed by Rodrigo Primo
parent 58d32a68fb
commit 4deb137063
5 changed files with 4 additions and 20 deletions

View File

@@ -404,8 +404,8 @@ class NewslettersRepository extends Repository {
/** /**
* @return NewsletterEntity[] * @return NewsletterEntity[]
*/ */
public function findSendigNotificationHistoryWithPausedTask(NewsletterEntity $newsletter): array { public function findSendingNotificationHistoryWithoutPausedTask(NewsletterEntity $newsletter): array {
$result = $this->entityManager->createQueryBuilder() return $this->entityManager->createQueryBuilder()
->select('n') ->select('n')
->from(NewsletterEntity::class, 'n') ->from(NewsletterEntity::class, 'n')
->join('n.queues', 'q') ->join('n.queues', 'q')
@@ -418,8 +418,7 @@ class NewslettersRepository extends Repository {
->setParameter('type', NewsletterEntity::TYPE_NOTIFICATION_HISTORY) ->setParameter('type', NewsletterEntity::TYPE_NOTIFICATION_HISTORY)
->setParameter('status', NewsletterEntity::STATUS_SENDING) ->setParameter('status', NewsletterEntity::STATUS_SENDING)
->setParameter('taskStatus', ScheduledTaskEntity::STATUS_PAUSED) ->setParameter('taskStatus', ScheduledTaskEntity::STATUS_PAUSED)
->getQuery()->execute(); ->getQuery()->getResult();
return $result;
} }
/** /**

View File

@@ -110,7 +110,7 @@ class PostNotificationScheduler {
} }
public function createPostNotificationSendingTask(NewsletterEntity $newsletter): ?ScheduledTaskEntity { public function createPostNotificationSendingTask(NewsletterEntity $newsletter): ?ScheduledTaskEntity {
$notificationHistory = $this->newslettersRepository->findSendigNotificationHistoryWithPausedTask($newsletter); $notificationHistory = $this->newslettersRepository->findSendingNotificationHistoryWithoutPausedTask($newsletter);
if (count($notificationHistory) > 0) { if (count($notificationHistory) > 0) {
return null; return null;
} }

View File

@@ -485,11 +485,6 @@ parameters:
count: 2 count: 2
path: ../../lib/Newsletter/NewslettersRepository.php path: ../../lib/Newsletter/NewslettersRepository.php
-
message: "#^Method MailPoet\\\\Newsletter\\\\NewslettersRepository\\:\\:findSendigNotificationHistoryWithPausedTask\\(\\) should return array\\<MailPoet\\\\Entities\\\\NewsletterEntity\\> but returns mixed\\.$#"
count: 1
path: ../../lib/Newsletter/NewslettersRepository.php
- -
message: "#^Method MailPoet\\\\Newsletter\\\\Renderer\\\\Renderer\\:\\:postProcessTemplate\\(\\) should return string but returns mixed\\.$#" message: "#^Method MailPoet\\\\Newsletter\\\\Renderer\\\\Renderer\\:\\:postProcessTemplate\\(\\) should return string but returns mixed\\.$#"
count: 1 count: 1

View File

@@ -485,11 +485,6 @@ parameters:
count: 2 count: 2
path: ../../lib/Newsletter/NewslettersRepository.php path: ../../lib/Newsletter/NewslettersRepository.php
-
message: "#^Method MailPoet\\\\Newsletter\\\\NewslettersRepository\\:\\:findSendigNotificationHistoryWithPausedTask\\(\\) should return array\\<MailPoet\\\\Entities\\\\NewsletterEntity\\> but returns mixed\\.$#"
count: 1
path: ../../lib/Newsletter/NewslettersRepository.php
- -
message: "#^Method MailPoet\\\\Newsletter\\\\Renderer\\\\Renderer\\:\\:postProcessTemplate\\(\\) should return string but returns mixed\\.$#" message: "#^Method MailPoet\\\\Newsletter\\\\Renderer\\\\Renderer\\:\\:postProcessTemplate\\(\\) should return string but returns mixed\\.$#"
count: 1 count: 1

View File

@@ -484,11 +484,6 @@ parameters:
count: 2 count: 2
path: ../../lib/Newsletter/NewslettersRepository.php path: ../../lib/Newsletter/NewslettersRepository.php
-
message: "#^Method MailPoet\\\\Newsletter\\\\NewslettersRepository\\:\\:findSendigNotificationHistoryWithPausedTask\\(\\) should return array\\<MailPoet\\\\Entities\\\\NewsletterEntity\\> but returns mixed\\.$#"
count: 1
path: ../../lib/Newsletter/NewslettersRepository.php
- -
message: "#^Method MailPoet\\\\Newsletter\\\\Renderer\\\\Renderer\\:\\:postProcessTemplate\\(\\) should return string but returns mixed\\.$#" message: "#^Method MailPoet\\\\Newsletter\\\\Renderer\\\\Renderer\\:\\:postProcessTemplate\\(\\) should return string but returns mixed\\.$#"
count: 1 count: 1