Fix code style by updated ruleset
[MAILPOET-3912]
This commit is contained in:
@@ -64,7 +64,8 @@ class DaemonHttpRunner {
|
||||
if (!$this->settingsDaemonData) {
|
||||
$error = WPFunctions::get()->__('Daemon does not exist.', 'mailpoet');
|
||||
} else {
|
||||
if (!isset($requestData['token']) ||
|
||||
if (
|
||||
!isset($requestData['token']) ||
|
||||
$requestData['token'] !== $this->settingsDaemonData['token']
|
||||
) {
|
||||
$error = 'Invalid or missing token.';
|
||||
@@ -81,7 +82,8 @@ class DaemonHttpRunner {
|
||||
$this->daemon->run($this->settingsDaemonData);
|
||||
// If we're using the WordPress trigger, check the conditions to stop cron if necessary
|
||||
$enableCronSelfDeactivation = WPFunctions::get()->applyFilters('mailpoet_cron_enable_self_deactivation', false);
|
||||
if ($enableCronSelfDeactivation
|
||||
if (
|
||||
$enableCronSelfDeactivation
|
||||
&& $this->isCronTriggerMethodWordPress()
|
||||
&& !$this->checkWPTriggerExecutionRequirements()
|
||||
) {
|
||||
|
@@ -338,7 +338,7 @@ class WordPress {
|
||||
$type = $options['type'];
|
||||
foreach ($options['scheduled_in'] as $scheduledIn) {
|
||||
foreach ($options['status'] as $status) {
|
||||
if (! empty($this->tasksCounts[$type][$scheduledIn][$status])) {
|
||||
if (!empty($this->tasksCounts[$type][$scheduledIn][$status])) {
|
||||
$count += $this->tasksCounts[$type][$scheduledIn][$status];
|
||||
}
|
||||
}
|
||||
|
@@ -221,7 +221,8 @@ class Scheduler {
|
||||
$queue->delete();
|
||||
return false;
|
||||
}
|
||||
if ($newsletter->role !== WelcomeScheduler::WORDPRESS_ALL_ROLES
|
||||
if (
|
||||
$newsletter->role !== WelcomeScheduler::WORDPRESS_ALL_ROLES
|
||||
&& !in_array($newsletter->role, ((array)$wpUser)['roles'])
|
||||
) {
|
||||
$queue->delete();
|
||||
|
@@ -30,7 +30,8 @@ class Migration extends SimpleWorker {
|
||||
$unmigratedQueueSubscribers = $this->getTaskIdsForUnmigratedSubscribers();
|
||||
}
|
||||
|
||||
if (!$unmigratedColumns ||
|
||||
if (
|
||||
!$unmigratedColumns ||
|
||||
($unmigratedQueuesCount == 0
|
||||
&& count($unmigratedQueueSubscribers) == 0)
|
||||
) {
|
||||
|
@@ -147,7 +147,8 @@ class Newsletter {
|
||||
$renderedNewsletter = $this->gaTracking->applyGATracking($renderedNewsletter, $newsletter);
|
||||
}
|
||||
// check if this is a post notification and if it contains at least 1 ALC post
|
||||
if ($newsletter->type === NewsletterModel::TYPE_NOTIFICATION_HISTORY &&
|
||||
if (
|
||||
$newsletter->type === NewsletterModel::TYPE_NOTIFICATION_HISTORY &&
|
||||
$this->postsTask->getAlcPostsCount($renderedNewsletter, $newsletter) === 0
|
||||
) {
|
||||
// delete notification history record since it will never be sent
|
||||
@@ -232,7 +233,8 @@ class Newsletter {
|
||||
|
||||
public function markNewsletterAsSent($newsletter, $queue) {
|
||||
// if it's a standard or notification history newsletter, update its status
|
||||
if ($newsletter->type === NewsletterModel::TYPE_STANDARD ||
|
||||
if (
|
||||
$newsletter->type === NewsletterModel::TYPE_STANDARD ||
|
||||
$newsletter->type === NewsletterModel::TYPE_NOTIFICATION_HISTORY
|
||||
) {
|
||||
$newsletter->status = NewsletterModel::STATUS_SENT;
|
||||
|
Reference in New Issue
Block a user